alptugay opened a new issue, #2610:
URL: https://github.com/apache/apisix-dashboard/issues/2610

   ### Issue description
   
   I am trying to add a route with a name of 58 characters. I am getting the 
following error:
   `
   {"code":10004,"message":"input validate failed: Key: 
'UpdateInput.Route.Name' Error:Field validation for 'Name' failed on the 'max' 
tag","data":null,"request_id":"e4ff8fea-7a46-492b-9d0d-b0b81c12ad75"}
   `
   In schema.json file route name is defined with the following values (line 
number 409):
   ```
     "name": {
        "maxLength": 100,
        "minLength": 1,
         "type": "string"
    },
   ```
   
   However in entity.go file the Route struct is defined as the following:
   
   ```
   type Route struct {
           BaseInfo
           URI             string                 `json:"uri,omitempty"`
           Uris            []string               `json:"uris,omitempty"`
   `        Name            string                 `json:"name" 
validate:"max=50"``
           Desc            string                 `json:"desc,omitempty" 
validate:"max=256"`
           Priority        int                    `json:"priority,omitempty"`
           Methods         []string               `json:"methods,omitempty"`
           Host            string                 `json:"host,omitempty"`
           Hosts           []string               `json:"hosts,omitempty"`
           RemoteAddr      string                 `json:"remote_addr,omitempty"`
           RemoteAddrs     []string               
`json:"remote_addrs,omitempty"`
           Vars            []interface{}          `json:"vars,omitempty"`
           FilterFunc      string                 `json:"filter_func,omitempty"`
           Script          interface{}            `json:"script,omitempty"`
           ScriptID        interface{}            `json:"script_id,omitempty"` 
// For debug and optimization(cache), currently same as Route's ID
           Plugins         map[string]interface{} `json:"plugins,omitempty"`
           PluginConfigID  interface{}            
`json:"plugin_config_id,omitempty"`
           Upstream        *UpstreamDef           `json:"upstream,omitempty"`
           ServiceID       interface{}            `json:"service_id,omitempty"`
           UpstreamID      interface{}            `json:"upstream_id,omitempty"`
           ServiceProtocol string                 
`json:"service_protocol,omitempty"`
           Labels          map[string]string      `json:"labels,omitempty"`
           EnableWebsocket bool                   
`json:"enable_websocket,omitempty"`
           Status          Status                 `json:"status"`
   }
   ```
   
   There seems to be an inconsistence between the two.
   
   ### Expected behavior
   
   According to the schema.json file I am expecting to be able to add a route 
with a name of 100 characters. Even if that would seem too much, at least I 
think 64 characters should be supported in the naming convention.
   
   ### How to Reproduce
   
   Add a route with a name of more than 50 characters.
   
   ### Screenshots
   
   _No response_
   
   ### Environment
   
   - apisix-dashboard version 2.13.0
   
   
   
   ### Additional context
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to