Skip to content

Validation specified in parameters -> schema do not show in mustache tags? #4495

@antihax

Description

@antihax
Description

It appears that validation parameters (min/max, length, items, etc) that are put into the parameters { schema { } } (such as for body parameters) do not show up in codegen mustache tags and cannot be used to validate input.

Is this intended or missing functionality?

Swagger-codegen version

HEAD

Swagger declaration file content or url
{  
                  "description":"A list of contacts to edit",
                  "in":"body",
                  "name":"contact_ids",
                  "required":true,
                  "schema":{  
                     "description":"contact_ids array",
                     "items":{  
                        "description":"ID of the contact to edit",
                        "format":"int32",
                        "title":"delete_characters_character_id_contacts_contact_id",
                        "type":"integer"
                     },
                     "maxItems":20,
                     "minItems":1,
                     "title":"delete_characters_character_id_contacts_contact_ids",
                     "type":"array"
                  }
               },

Mustache output:

{
        "isBodyParam" : true,
        "hasMore" : true,
        "isContainer" : true,
        "secondaryParam" : true,
        "isPrimitiveType" : true,
        "baseName" : "contact_ids",
        "paramName" : "contactIds",
        "dataType" : "[]int32",
        "description" : "A list of contacts to edit",
        "unescapedDescription" : "A list of contacts to edit",
        "jsonSchema" : "{\r\n  \"in\" : \"body\",\r\n  \"name\" : \"contact_ids\",\r\n  \"description\" : \"A list of contacts to edit\",\r\n  \"required\" : true,\r\n  \"schema\" : {\r\n    \"title\" : \"delete_characters_character_id_contacts_contact_ids\",\r\n    \"type\" : \"array\",\r\n    \"description\" : \"contact_ids array\",\r\n    \"items\" : {\r\n      \"type\" : \"integer\",\r\n      \"format\" : \"int32\",\r\n      \"description\" : \"ID of the contact to edit\",\r\n      \"title\" : \"delete_characters_character_id_contacts_contact_id\"\r\n    }\r\n  }\r\n}",
        "isBinary" : false,
        "isListContainer" : true,
        "isEnum" : false,
        "vendorExtensions" : {
          "x-exportParamName" : "ContactIds"
        },
        "required" : true
      }, 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions