swagger-api / swagger-codegen-generators

Apache License 2.0
284 stars 425 forks source link

Operation info: The generated information does not match the expectations. #1250

Open BruceCham opened 9 months ago

BruceCham commented 9 months ago

Hi, When I use the following command to generate some language type(for: go/typescript ...), I find that the Operation info does not meet the expectation. Some parameters are non-required, but all of the output infos are [required: true].

java -DdebugOperations -jar ./swagger-codegen-cli-3.0.52.jar generate -i ./swagger.json -l go

swagger.json

{
  "openapi": "3.0.0",
  "info": {
    "title": "API",
    "version": "1.0.0",
    "description": "API",
    "contact": {
      "name": "Swagger",
      "email": "team@swagger.com"
    }
  },
  "paths": {
    "/users": {
      "post": {
        "summary": "new user",
        "operationId": "createUser",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "avatar": {
                    "type": "string"
                  },
                  "age": {
                    "type": "integer"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "avatar": {
            "type": "string"
          },
          "age": {
            "type": "integer"
          }
        }
      }
    }
  }
}

output operation info

[
  {
    "importPath": "swagger.Default",
    "infoName": "Swagger",
    "appVersion": "1.0.0",
    "generatedYear": "2024",
    "generatorClass": "io.swagger.codegen.v3.generators.go.GoClientCodegen",
    "modelPackage": "swagger",
    "sortParamsByRequiredFlag": true,
    "apiDocPath": "docs/",
    "classVarName": "default",
    "hasModel": true,
    "generateModelDocs": true,
    "hasImport": true,
    "generateModelTests": true,
    "basePathWithoutHost": "",
    "generateApiTests": true,
    "classFilename": "api_default",
    "operations": {
      "classname": "DefaultApi",
      "operation": [
        {
          "vendorExtensions": {
            "x-has-consumes": true,
            "x-has-required-params": true,
            "x-is-restful-show": false,
            "x-has-reference": true,
            "x-is-restful-index": false,
            "x-is-restful-destroy": false,
            "x-has-more": false,
            "x-has-params": true,
            "x-is-post-method": true,
            "x-has-optional-params": false,
            "x-is-restful": false,
            "x-is-restful-update": false,
            "x-has-produces": true,
            "x-is-restful-create": false
          },
          "responseHeaders": [],
          "returnTypeIsPrimitive": false,
          "returnSimpleType": true,
          "subresourceOperation": false,
          "path": "/users",
          "operationId": "CreateUser",
          "returnType": "User",
          "httpMethod": "Post",
          "returnBaseType": "User",
          "summary": "new user",
          "baseName": "Default",
          "defaultResponse": "null",
          "testPath": "/users",
          "consumes": [
            {
              "mediaType": "multipart/form-data"
            }
          ],
          "produces": [
            {
              "mediaType": "application/json"
            }
          ],
          "contents": [
            {
              "contentType": "multipart/form-data",
              "parameters": [
                {
                  "vendorExtensions": {
                    "x-is-form-param": true,
                    "x-is-nullable": false,
                    "x-is-multipart": true,
                    "x-is-primitive-type": true,
                    "x-exportParamName": "Name",
                    "x-has-more": true,
                    "x-is-string": true
                  },
                  "secondaryParam": false,
                  "baseName": "name",
                  "paramName": "name",
                  "dataType": "string",
                  "example": "name_example",
                  "jsonSchema": "{\n  \"name\" : \"name\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"string\"\n  }\n}",
                  "nullable": false,
                  "isJson": false,
                  "required": true,
                  "exclusiveMaximum": false,
                  "exclusiveMinimum": false,
                  "uniqueItems": false,
                  "notFile": true,
                  "isFormParam": true,
                  "isPathParam": false,
                  "isBodyParam": false,
                  "isQueryParam": false,
                  "isHeaderParam": false,
                  "isCookieParam": false,
                  "isCollectionFormatMulti": false,
                  "isInteger": false,
                  "isNumber": false,
                  "hasHeaders": false,
                  "isString": true,
                  "isNumeric": false,
                  "isLong": false,
                  "isFloat": false,
                  "isDouble": false,
                  "isByteArray": false,
                  "isBoolean": false,
                  "isDate": false,
                  "isDateTime": false,
                  "isUuid": false,
                  "isDefault": false,
                  "isMultipart": true,
                  "isBinary": false,
                  "isFile": false,
                  "isEnum": false,
                  "isAlias": false,
                  "isObject": false,
                  "isContainer": false,
                  "isReadOnly": false,
                  "isNullable": false,
                  "hasMore": true,
                  "isMapContainer": false,
                  "isListContainer": false,
                  "isResponseBinary": false,
                  "isResponseFile": false,
                  "isArrayModel": false,
                  "isPrimitiveType": true,
                  "hasInnerObject": false,
                  "isNotContainer": false
                },
                {
                  "vendorExtensions": {
                    "x-is-form-param": true,
                    "x-is-nullable": false,
                    "x-is-multipart": true,
                    "x-is-primitive-type": true,
                    "x-exportParamName": "Email",
                    "x-has-more": true,
                    "x-is-string": true
                  },
                  "secondaryParam": true,
                  "baseName": "email",
                  "paramName": "email",
                  "dataType": "string",
                  "example": "email_example",
                  "jsonSchema": "{\n  \"name\" : \"email\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"string\"\n  }\n}",
                  "nullable": false,
                  "isJson": false,
                  "required": true,
                  "exclusiveMaximum": false,
                  "exclusiveMinimum": false,
                  "uniqueItems": false,
                  "notFile": true,
                  "isFormParam": true,
                  "isPathParam": false,
                  "isBodyParam": false,
                  "isQueryParam": false,
                  "isHeaderParam": false,
                  "isCookieParam": false,
                  "isCollectionFormatMulti": false,
                  "isInteger": false,
                  "isNumber": false,
                  "hasHeaders": false,
                  "isString": true,
                  "isNumeric": false,
                  "isLong": false,
                  "isFloat": false,
                  "isDouble": false,
                  "isByteArray": false,
                  "isBoolean": false,
                  "isDate": false,
                  "isDateTime": false,
                  "isUuid": false,
                  "isDefault": false,
                  "isMultipart": true,
                  "isBinary": false,
                  "isFile": false,
                  "isEnum": false,
                  "isAlias": false,
                  "isObject": false,
                  "isContainer": false,
                  "isReadOnly": false,
                  "isNullable": false,
                  "hasMore": true,
                  "isMapContainer": false,
                  "isListContainer": false,
                  "isResponseBinary": false,
                  "isResponseFile": false,
                  "isArrayModel": false,
                  "isPrimitiveType": true,
                  "hasInnerObject": false,
                  "isNotContainer": false
                },
                {
                  "vendorExtensions": {
                    "x-is-form-param": true,
                    "x-is-nullable": false,
                    "x-is-multipart": true,
                    "x-is-primitive-type": true,
                    "x-exportParamName": "Avatar",
                    "x-has-more": true,
                    "x-is-string": true
                  },
                  "secondaryParam": true,
                  "baseName": "avatar",
                  "paramName": "avatar",
                  "dataType": "string",
                  "example": "avatar_example",
                  "jsonSchema": "{\n  \"name\" : \"avatar\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"string\"\n  }\n}",
                  "nullable": false,
                  "isJson": false,
                  "required": true,
                  "exclusiveMaximum": false,
                  "exclusiveMinimum": false,
                  "uniqueItems": false,
                  "notFile": true,
                  "isFormParam": true,
                  "isPathParam": false,
                  "isBodyParam": false,
                  "isQueryParam": false,
                  "isHeaderParam": false,
                  "isCookieParam": false,
                  "isCollectionFormatMulti": false,
                  "isInteger": false,
                  "isNumber": false,
                  "hasHeaders": false,
                  "isString": true,
                  "isNumeric": false,
                  "isLong": false,
                  "isFloat": false,
                  "isDouble": false,
                  "isByteArray": false,
                  "isBoolean": false,
                  "isDate": false,
                  "isDateTime": false,
                  "isUuid": false,
                  "isDefault": false,
                  "isMultipart": true,
                  "isBinary": false,
                  "isFile": false,
                  "isEnum": false,
                  "isAlias": false,
                  "isObject": false,
                  "isContainer": false,
                  "isReadOnly": false,
                  "isNullable": false,
                  "hasMore": true,
                  "isMapContainer": false,
                  "isListContainer": false,
                  "isResponseBinary": false,
                  "isResponseFile": false,
                  "isArrayModel": false,
                  "isPrimitiveType": true,
                  "hasInnerObject": false,
                  "isNotContainer": false
                },
                {
                  "vendorExtensions": {
                    "x-is-integer": true,
                    "x-is-form-param": true,
                    "x-is-nullable": false,
                    "x-is-multipart": true,
                    "x-is-primitive-type": true,
                    "x-exportParamName": "Age",
                    "x-has-more": false
                  },
                  "secondaryParam": true,
                  "baseName": "age",
                  "paramName": "age",
                  "dataType": "int32",
                  "example": "56",
                  "jsonSchema": "{\n  \"name\" : \"age\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"integer\"\n  }\n}",
                  "nullable": false,
                  "isJson": false,
                  "required": true,
                  "exclusiveMaximum": false,
                  "exclusiveMinimum": false,
                  "uniqueItems": false,
                  "notFile": true,
                  "isFormParam": true,
                  "isPathParam": false,
                  "isBodyParam": false,
                  "isQueryParam": false,
                  "isHeaderParam": false,
                  "isCookieParam": false,
                  "isCollectionFormatMulti": false,
                  "isInteger": true,
                  "isNumber": false,
                  "hasHeaders": false,
                  "isString": false,
                  "isNumeric": false,
                  "isLong": false,
                  "isFloat": false,
                  "isDouble": false,
                  "isByteArray": false,
                  "isBoolean": false,
                  "isDate": false,
                  "isDateTime": false,
                  "isUuid": false,
                  "isDefault": false,
                  "isMultipart": true,
                  "isBinary": false,
                  "isFile": false,
                  "isEnum": false,
                  "isAlias": false,
                  "isObject": false,
                  "isContainer": false,
                  "isReadOnly": false,
                  "isNullable": false,
                  "hasMore": false,
                  "isMapContainer": false,
                  "isListContainer": false,
                  "isResponseBinary": false,
                  "isResponseFile": false,
                  "isArrayModel": false,
                  "isPrimitiveType": true,
                  "hasInnerObject": false,
                  "isNotContainer": false
                }
              ],
              "contentExtensions": {
                "x-is-form": true
              },
              "isForm": true
            }
          ],
          "allParams": [
            {
              "vendorExtensions": {
                "x-is-form-param": true,
                "x-is-nullable": false,
                "x-is-multipart": true,
                "x-is-primitive-type": true,
                "x-exportParamName": "Name",
                "x-has-more": true,
                "x-is-string": true
              },
              "secondaryParam": false,
              "baseName": "name",
              "paramName": "name",
              "dataType": "string",
              "example": "name_example",
              "jsonSchema": "{\n  \"name\" : \"name\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"string\"\n  }\n}",
              "nullable": false,
              "isJson": false,
              "required": true,
              "exclusiveMaximum": false,
              "exclusiveMinimum": false,
              "uniqueItems": false,
              "notFile": true,
              "isFormParam": true,
              "isPathParam": false,
              "isBodyParam": false,
              "isQueryParam": false,
              "isHeaderParam": false,
              "isCookieParam": false,
              "isCollectionFormatMulti": false,
              "isInteger": false,
              "isNumber": false,
              "hasHeaders": false,
              "isString": true,
              "isNumeric": false,
              "isLong": false,
              "isFloat": false,
              "isDouble": false,
              "isByteArray": false,
              "isBoolean": false,
              "isDate": false,
              "isDateTime": false,
              "isUuid": false,
              "isDefault": false,
              "isMultipart": true,
              "isBinary": false,
              "isFile": false,
              "isEnum": false,
              "isAlias": false,
              "isObject": false,
              "isContainer": false,
              "isReadOnly": false,
              "isNullable": false,
              "hasMore": true,
              "isMapContainer": false,
              "isListContainer": false,
              "isResponseBinary": false,
              "isResponseFile": false,
              "isArrayModel": false,
              "isPrimitiveType": true,
              "hasInnerObject": false,
              "isNotContainer": false
            },
            {
              "vendorExtensions": {
                "x-is-form-param": true,
                "x-is-nullable": false,
                "x-is-multipart": true,
                "x-is-primitive-type": true,
                "x-exportParamName": "Email",
                "x-has-more": true,
                "x-is-string": true
              },
              "secondaryParam": true,
              "baseName": "email",
              "paramName": "email",
              "dataType": "string",
              "example": "email_example",
              "jsonSchema": "{\n  \"name\" : \"email\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"string\"\n  }\n}",
              "nullable": false,
              "isJson": false,
              "required": true,
              "exclusiveMaximum": false,
              "exclusiveMinimum": false,
              "uniqueItems": false,
              "notFile": true,
              "isFormParam": true,
              "isPathParam": false,
              "isBodyParam": false,
              "isQueryParam": false,
              "isHeaderParam": false,
              "isCookieParam": false,
              "isCollectionFormatMulti": false,
              "isInteger": false,
              "isNumber": false,
              "hasHeaders": false,
              "isString": true,
              "isNumeric": false,
              "isLong": false,
              "isFloat": false,
              "isDouble": false,
              "isByteArray": false,
              "isBoolean": false,
              "isDate": false,
              "isDateTime": false,
              "isUuid": false,
              "isDefault": false,
              "isMultipart": true,
              "isBinary": false,
              "isFile": false,
              "isEnum": false,
              "isAlias": false,
              "isObject": false,
              "isContainer": false,
              "isReadOnly": false,
              "isNullable": false,
              "hasMore": true,
              "isMapContainer": false,
              "isListContainer": false,
              "isResponseBinary": false,
              "isResponseFile": false,
              "isArrayModel": false,
              "isPrimitiveType": true,
              "hasInnerObject": false,
              "isNotContainer": false
            },
            {
              "vendorExtensions": {
                "x-is-form-param": true,
                "x-is-nullable": false,
                "x-is-multipart": true,
                "x-is-primitive-type": true,
                "x-exportParamName": "Avatar",
                "x-has-more": true,
                "x-is-string": true
              },
              "secondaryParam": true,
              "baseName": "avatar",
              "paramName": "avatar",
              "dataType": "string",
              "example": "avatar_example",
              "jsonSchema": "{\n  \"name\" : \"avatar\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"string\"\n  }\n}",
              "nullable": false,
              "isJson": false,
              "required": true,
              "exclusiveMaximum": false,
              "exclusiveMinimum": false,
              "uniqueItems": false,
              "notFile": true,
              "isFormParam": true,
              "isPathParam": false,
              "isBodyParam": false,
              "isQueryParam": false,
              "isHeaderParam": false,
              "isCookieParam": false,
              "isCollectionFormatMulti": false,
              "isInteger": false,
              "isNumber": false,
              "hasHeaders": false,
              "isString": true,
              "isNumeric": false,
              "isLong": false,
              "isFloat": false,
              "isDouble": false,
              "isByteArray": false,
              "isBoolean": false,
              "isDate": false,
              "isDateTime": false,
              "isUuid": false,
              "isDefault": false,
              "isMultipart": true,
              "isBinary": false,
              "isFile": false,
              "isEnum": false,
              "isAlias": false,
              "isObject": false,
              "isContainer": false,
              "isReadOnly": false,
              "isNullable": false,
              "hasMore": true,
              "isMapContainer": false,
              "isListContainer": false,
              "isResponseBinary": false,
              "isResponseFile": false,
              "isArrayModel": false,
              "isPrimitiveType": true,
              "hasInnerObject": false,
              "isNotContainer": false
            },
            {
              "vendorExtensions": {
                "x-is-integer": true,
                "x-is-form-param": true,
                "x-is-nullable": false,
                "x-is-multipart": true,
                "x-is-primitive-type": true,
                "x-exportParamName": "Age",
                "x-has-more": false
              },
              "secondaryParam": true,
              "baseName": "age",
              "paramName": "age",
              "dataType": "int32",
              "example": "56",
              "jsonSchema": "{\n  \"name\" : \"age\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"integer\"\n  }\n}",
              "nullable": false,
              "isJson": false,
              "required": true,
              "exclusiveMaximum": false,
              "exclusiveMinimum": false,
              "uniqueItems": false,
              "notFile": true,
              "isFormParam": true,
              "isPathParam": false,
              "isBodyParam": false,
              "isQueryParam": false,
              "isHeaderParam": false,
              "isCookieParam": false,
              "isCollectionFormatMulti": false,
              "isInteger": true,
              "isNumber": false,
              "hasHeaders": false,
              "isString": false,
              "isNumeric": false,
              "isLong": false,
              "isFloat": false,
              "isDouble": false,
              "isByteArray": false,
              "isBoolean": false,
              "isDate": false,
              "isDateTime": false,
              "isUuid": false,
              "isDefault": false,
              "isMultipart": true,
              "isBinary": false,
              "isFile": false,
              "isEnum": false,
              "isAlias": false,
              "isObject": false,
              "isContainer": false,
              "isReadOnly": false,
              "isNullable": false,
              "hasMore": false,
              "isMapContainer": false,
              "isListContainer": false,
              "isResponseBinary": false,
              "isResponseFile": false,
              "isArrayModel": false,
              "isPrimitiveType": true,
              "hasInnerObject": false,
              "isNotContainer": false
            }
          ],
          "bodyParams": [],
          "pathParams": [],
          "queryParams": [],
          "headerParams": [],
          "cookieParams": [],
          "formParams": [
            {
              "vendorExtensions": {
                "x-is-form-param": true,
                "x-is-nullable": false,
                "x-is-multipart": true,
                "x-is-primitive-type": true,
                "x-exportParamName": "Name",
                "x-has-more": true,
                "x-is-string": true
              },
              "secondaryParam": false,
              "baseName": "name",
              "paramName": "name",
              "dataType": "string",
              "example": "name_example",
              "jsonSchema": "{\n  \"name\" : \"name\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"string\"\n  }\n}",
              "nullable": false,
              "isJson": false,
              "required": true,
              "exclusiveMaximum": false,
              "exclusiveMinimum": false,
              "uniqueItems": false,
              "notFile": true,
              "isFormParam": true,
              "isPathParam": false,
              "isBodyParam": false,
              "isQueryParam": false,
              "isHeaderParam": false,
              "isCookieParam": false,
              "isCollectionFormatMulti": false,
              "isInteger": false,
              "isNumber": false,
              "hasHeaders": false,
              "isString": true,
              "isNumeric": false,
              "isLong": false,
              "isFloat": false,
              "isDouble": false,
              "isByteArray": false,
              "isBoolean": false,
              "isDate": false,
              "isDateTime": false,
              "isUuid": false,
              "isDefault": false,
              "isMultipart": true,
              "isBinary": false,
              "isFile": false,
              "isEnum": false,
              "isAlias": false,
              "isObject": false,
              "isContainer": false,
              "isReadOnly": false,
              "isNullable": false,
              "hasMore": true,
              "isMapContainer": false,
              "isListContainer": false,
              "isResponseBinary": false,
              "isResponseFile": false,
              "isArrayModel": false,
              "isPrimitiveType": true,
              "hasInnerObject": false,
              "isNotContainer": false
            },
            {
              "vendorExtensions": {
                "x-is-form-param": true,
                "x-is-nullable": false,
                "x-is-multipart": true,
                "x-is-primitive-type": true,
                "x-exportParamName": "Email",
                "x-has-more": true,
                "x-is-string": true
              },
              "secondaryParam": true,
              "baseName": "email",
              "paramName": "email",
              "dataType": "string",
              "example": "email_example",
              "jsonSchema": "{\n  \"name\" : \"email\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"string\"\n  }\n}",
              "nullable": false,
              "isJson": false,
              "required": true,
              "exclusiveMaximum": false,
              "exclusiveMinimum": false,
              "uniqueItems": false,
              "notFile": true,
              "isFormParam": true,
              "isPathParam": false,
              "isBodyParam": false,
              "isQueryParam": false,
              "isHeaderParam": false,
              "isCookieParam": false,
              "isCollectionFormatMulti": false,
              "isInteger": false,
              "isNumber": false,
              "hasHeaders": false,
              "isString": true,
              "isNumeric": false,
              "isLong": false,
              "isFloat": false,
              "isDouble": false,
              "isByteArray": false,
              "isBoolean": false,
              "isDate": false,
              "isDateTime": false,
              "isUuid": false,
              "isDefault": false,
              "isMultipart": true,
              "isBinary": false,
              "isFile": false,
              "isEnum": false,
              "isAlias": false,
              "isObject": false,
              "isContainer": false,
              "isReadOnly": false,
              "isNullable": false,
              "hasMore": true,
              "isMapContainer": false,
              "isListContainer": false,
              "isResponseBinary": false,
              "isResponseFile": false,
              "isArrayModel": false,
              "isPrimitiveType": true,
              "hasInnerObject": false,
              "isNotContainer": false
            },
            {
              "vendorExtensions": {
                "x-is-form-param": true,
                "x-is-nullable": false,
                "x-is-multipart": true,
                "x-is-primitive-type": true,
                "x-exportParamName": "Avatar",
                "x-has-more": true,
                "x-is-string": true
              },
              "secondaryParam": true,
              "baseName": "avatar",
              "paramName": "avatar",
              "dataType": "string",
              "example": "avatar_example",
              "jsonSchema": "{\n  \"name\" : \"avatar\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"string\"\n  }\n}",
              "nullable": false,
              "isJson": false,
              "required": true,
              "exclusiveMaximum": false,
              "exclusiveMinimum": false,
              "uniqueItems": false,
              "notFile": true,
              "isFormParam": true,
              "isPathParam": false,
              "isBodyParam": false,
              "isQueryParam": false,
              "isHeaderParam": false,
              "isCookieParam": false,
              "isCollectionFormatMulti": false,
              "isInteger": false,
              "isNumber": false,
              "hasHeaders": false,
              "isString": true,
              "isNumeric": false,
              "isLong": false,
              "isFloat": false,
              "isDouble": false,
              "isByteArray": false,
              "isBoolean": false,
              "isDate": false,
              "isDateTime": false,
              "isUuid": false,
              "isDefault": false,
              "isMultipart": true,
              "isBinary": false,
              "isFile": false,
              "isEnum": false,
              "isAlias": false,
              "isObject": false,
              "isContainer": false,
              "isReadOnly": false,
              "isNullable": false,
              "hasMore": true,
              "isMapContainer": false,
              "isListContainer": false,
              "isResponseBinary": false,
              "isResponseFile": false,
              "isArrayModel": false,
              "isPrimitiveType": true,
              "hasInnerObject": false,
              "isNotContainer": false
            },
            {
              "vendorExtensions": {
                "x-is-integer": true,
                "x-is-form-param": true,
                "x-is-nullable": false,
                "x-is-multipart": true,
                "x-is-primitive-type": true,
                "x-exportParamName": "Age",
                "x-has-more": false
              },
              "secondaryParam": true,
              "baseName": "age",
              "paramName": "age",
              "dataType": "int32",
              "example": "56",
              "jsonSchema": "{\n  \"name\" : \"age\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"integer\"\n  }\n}",
              "nullable": false,
              "isJson": false,
              "required": true,
              "exclusiveMaximum": false,
              "exclusiveMinimum": false,
              "uniqueItems": false,
              "notFile": true,
              "isFormParam": true,
              "isPathParam": false,
              "isBodyParam": false,
              "isQueryParam": false,
              "isHeaderParam": false,
              "isCookieParam": false,
              "isCollectionFormatMulti": false,
              "isInteger": true,
              "isNumber": false,
              "hasHeaders": false,
              "isString": false,
              "isNumeric": false,
              "isLong": false,
              "isFloat": false,
              "isDouble": false,
              "isByteArray": false,
              "isBoolean": false,
              "isDate": false,
              "isDateTime": false,
              "isUuid": false,
              "isDefault": false,
              "isMultipart": true,
              "isBinary": false,
              "isFile": false,
              "isEnum": false,
              "isAlias": false,
              "isObject": false,
              "isContainer": false,
              "isReadOnly": false,
              "isNullable": false,
              "hasMore": false,
              "isMapContainer": false,
              "isListContainer": false,
              "isResponseBinary": false,
              "isResponseFile": false,
              "isArrayModel": false,
              "isPrimitiveType": true,
              "hasInnerObject": false,
              "isNotContainer": false
            }
          ],
          "requiredParams": [
            {
              "vendorExtensions": {
                "x-is-form-param": true,
                "x-is-nullable": false,
                "x-is-multipart": true,
                "x-is-primitive-type": true,
                "x-exportParamName": "Name",
                "x-has-more": true,
                "x-is-string": true
              },
              "secondaryParam": false,
              "baseName": "name",
              "paramName": "name",
              "dataType": "string",
              "example": "name_example",
              "jsonSchema": "{\n  \"name\" : \"name\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"string\"\n  }\n}",
              "nullable": false,
              "isJson": false,
              "required": true,
              "exclusiveMaximum": false,
              "exclusiveMinimum": false,
              "uniqueItems": false,
              "notFile": true,
              "isFormParam": true,
              "isPathParam": false,
              "isBodyParam": false,
              "isQueryParam": false,
              "isHeaderParam": false,
              "isCookieParam": false,
              "isCollectionFormatMulti": false,
              "isInteger": false,
              "isNumber": false,
              "hasHeaders": false,
              "isString": true,
              "isNumeric": false,
              "isLong": false,
              "isFloat": false,
              "isDouble": false,
              "isByteArray": false,
              "isBoolean": false,
              "isDate": false,
              "isDateTime": false,
              "isUuid": false,
              "isDefault": false,
              "isMultipart": true,
              "isBinary": false,
              "isFile": false,
              "isEnum": false,
              "isAlias": false,
              "isObject": false,
              "isContainer": false,
              "isReadOnly": false,
              "isNullable": false,
              "hasMore": true,
              "isMapContainer": false,
              "isListContainer": false,
              "isResponseBinary": false,
              "isResponseFile": false,
              "isArrayModel": false,
              "isPrimitiveType": true,
              "hasInnerObject": false,
              "isNotContainer": false
            },
            {
              "vendorExtensions": {
                "x-is-form-param": true,
                "x-is-nullable": false,
                "x-is-multipart": true,
                "x-is-primitive-type": true,
                "x-exportParamName": "Email",
                "x-has-more": true,
                "x-is-string": true
              },
              "secondaryParam": true,
              "baseName": "email",
              "paramName": "email",
              "dataType": "string",
              "example": "email_example",
              "jsonSchema": "{\n  \"name\" : \"email\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"string\"\n  }\n}",
              "nullable": false,
              "isJson": false,
              "required": true,
              "exclusiveMaximum": false,
              "exclusiveMinimum": false,
              "uniqueItems": false,
              "notFile": true,
              "isFormParam": true,
              "isPathParam": false,
              "isBodyParam": false,
              "isQueryParam": false,
              "isHeaderParam": false,
              "isCookieParam": false,
              "isCollectionFormatMulti": false,
              "isInteger": false,
              "isNumber": false,
              "hasHeaders": false,
              "isString": true,
              "isNumeric": false,
              "isLong": false,
              "isFloat": false,
              "isDouble": false,
              "isByteArray": false,
              "isBoolean": false,
              "isDate": false,
              "isDateTime": false,
              "isUuid": false,
              "isDefault": false,
              "isMultipart": true,
              "isBinary": false,
              "isFile": false,
              "isEnum": false,
              "isAlias": false,
              "isObject": false,
              "isContainer": false,
              "isReadOnly": false,
              "isNullable": false,
              "hasMore": true,
              "isMapContainer": false,
              "isListContainer": false,
              "isResponseBinary": false,
              "isResponseFile": false,
              "isArrayModel": false,
              "isPrimitiveType": true,
              "hasInnerObject": false,
              "isNotContainer": false
            },
            {
              "vendorExtensions": {
                "x-is-form-param": true,
                "x-is-nullable": false,
                "x-is-multipart": true,
                "x-is-primitive-type": true,
                "x-exportParamName": "Avatar",
                "x-has-more": true,
                "x-is-string": true
              },
              "secondaryParam": true,
              "baseName": "avatar",
              "paramName": "avatar",
              "dataType": "string",
              "example": "avatar_example",
              "jsonSchema": "{\n  \"name\" : \"avatar\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"string\"\n  }\n}",
              "nullable": false,
              "isJson": false,
              "required": true,
              "exclusiveMaximum": false,
              "exclusiveMinimum": false,
              "uniqueItems": false,
              "notFile": true,
              "isFormParam": true,
              "isPathParam": false,
              "isBodyParam": false,
              "isQueryParam": false,
              "isHeaderParam": false,
              "isCookieParam": false,
              "isCollectionFormatMulti": false,
              "isInteger": false,
              "isNumber": false,
              "hasHeaders": false,
              "isString": true,
              "isNumeric": false,
              "isLong": false,
              "isFloat": false,
              "isDouble": false,
              "isByteArray": false,
              "isBoolean": false,
              "isDate": false,
              "isDateTime": false,
              "isUuid": false,
              "isDefault": false,
              "isMultipart": true,
              "isBinary": false,
              "isFile": false,
              "isEnum": false,
              "isAlias": false,
              "isObject": false,
              "isContainer": false,
              "isReadOnly": false,
              "isNullable": false,
              "hasMore": true,
              "isMapContainer": false,
              "isListContainer": false,
              "isResponseBinary": false,
              "isResponseFile": false,
              "isArrayModel": false,
              "isPrimitiveType": true,
              "hasInnerObject": false,
              "isNotContainer": false
            },
            {
              "vendorExtensions": {
                "x-is-integer": true,
                "x-is-form-param": true,
                "x-is-nullable": false,
                "x-is-multipart": true,
                "x-is-primitive-type": true,
                "x-exportParamName": "Age",
                "x-has-more": false
              },
              "secondaryParam": true,
              "baseName": "age",
              "paramName": "age",
              "dataType": "int32",
              "example": "56",
              "jsonSchema": "{\n  \"name\" : \"age\",\n  \"required\" : true,\n  \"schema\" : {\n    \"type\" : \"integer\"\n  }\n}",
              "nullable": false,
              "isJson": false,
              "required": true,
              "exclusiveMaximum": false,
              "exclusiveMinimum": false,
              "uniqueItems": false,
              "notFile": true,
              "isFormParam": true,
              "isPathParam": false,
              "isBodyParam": false,
              "isQueryParam": false,
              "isHeaderParam": false,
              "isCookieParam": false,
              "isCollectionFormatMulti": false,
              "isInteger": true,
              "isNumber": false,
              "hasHeaders": false,
              "isString": false,
              "isNumeric": false,
              "isLong": false,
              "isFloat": false,
              "isDouble": false,
              "isByteArray": false,
              "isBoolean": false,
              "isDate": false,
              "isDateTime": false,
              "isUuid": false,
              "isDefault": false,
              "isMultipart": true,
              "isBinary": false,
              "isFile": false,
              "isEnum": false,
              "isAlias": false,
              "isObject": false,
              "isContainer": false,
              "isReadOnly": false,
              "isNullable": false,
              "hasMore": false,
              "isMapContainer": false,
              "isListContainer": false,
              "isResponseBinary": false,
              "isResponseFile": false,
              "isArrayModel": false,
              "isPrimitiveType": true,
              "hasInnerObject": false,
              "isNotContainer": false
            }
          ],
          "tags": [
            {
              "name": "default"
            }
          ],
          "responses": [
            {
              "vendorExtensions": {
                "x-has-headers": false,
                "x-is-primitive-type": false,
                "x-has-more": false,
                "x-is-simple-type": true,
                "x-is-default": true
              },
              "headers": [],
              "code": "200",
              "message": "success",
              "contents": [],
              "examples": [],
              "dataType": "User",
              "baseType": "User",
              "schema": {
                "$ref": "#/components/schemas/User"
              },
              "jsonSchema": "{\n  \"description\" : \"success\",\n  \"content\" : {\n    \"application/json\" : {\n      \"schema\" : {\n        \"$ref\" : \"#/components/schemas/User\"\n      }\n    }\n  }\n}",
              "wildcard": false,
              "simpleType": true,
              "primitiveType": false,
              "isCollectionFormatMulti": false,
              "isInteger": false,
              "isNumber": false,
              "hasHeaders": false,
              "isString": false,
              "isNumeric": false,
              "isLong": false,
              "isFloat": false,
              "isDouble": false,
              "isByteArray": false,
              "isBoolean": false,
              "isDate": false,
              "isDateTime": false,
              "isUuid": false,
              "isDefault": true,
              "isMultipart": false,
              "isBinary": false,
              "isFile": false,
              "isEnum": false,
              "isAlias": false,
              "isObject": false,
              "isContainer": false,
              "isReadOnly": false,
              "isNullable": false,
              "hasMore": false,
              "isMapContainer": false,
              "isListContainer": false,
              "isResponseBinary": false,
              "isResponseFile": false,
              "isArrayModel": false,
              "isPrimitiveType": false,
              "hasInnerObject": false,
              "isNotContainer": false
            }
          ],
          "imports": [
            "User"
          ],
          "examples": [
            {
              "contentType": "application/json",
              "example": "{\n  \"name\" : \"name\",\n  \"id\" : 0,\n  \"avatar\" : \"avatar\",\n  \"email\" : \"email\",\n  \"age\" : 6\n}"
            }
          ],
          "nickname": "CreateUser",
          "operationIdLowerCase": "createuser",
          "operationIdCamelCase": "CreateUser",
          "operationIdSnakeCase": "create_user",
          "hasExamples": true,
          "hasConsumes": true,
          "hasProduces": true,
          "hasParams": true,
          "isRestful": false,
          "isRestfulShow": false,
          "isRestfulIndex": false,
          "isRestfulCreate": false,
          "isRestfulUpdate": false,
          "isRestfulDestroy": false,
          "hasBodyParam": false,
          "hasQueryParams": false,
          "hasHeaderParams": false,
          "hasCookieParams": false,
          "hasPathParams": false,
          "hasFormParams": true,
          "isBodyAllowed": true,
          "isDeprecated": false,
          "hasAuthMethods": false,
          "hasOptionalParams": false,
          "hasRequiredParams": true,
          "hasReference": true,
          "isCollectionFormatMulti": false,
          "isInteger": false,
          "isNumber": false,
          "hasHeaders": false,
          "isString": false,
          "isNumeric": false,
          "isLong": false,
          "isFloat": false,
          "isDouble": false,
          "isByteArray": false,
          "isBoolean": false,
          "isDate": false,
          "isDateTime": false,
          "isUuid": false,
          "isDefault": false,
          "isMultipart": false,
          "isBinary": false,
          "isFile": false,
          "isEnum": false,
          "isAlias": false,
          "isObject": false,
          "isContainer": false,
          "isReadOnly": false,
          "isNullable": false,
          "hasMore": false,
          "isMapContainer": false,
          "isListContainer": false,
          "isResponseBinary": false,
          "isResponseFile": false,
          "isArrayModel": false,
          "isPrimitiveType": false,
          "hasInnerObject": false,
          "isNotContainer": false
        }
      ],
      "pathPrefix": "default"
    },
    "inputSpec": "{\n  \"openapi\": \"3.0.0\",\n  \"info\": {\n    \"title\": \"API\",\n    \"version\": \"1.0.0\",\n    \"description\": \"API\",\n    \"contact\": {\n      \"name\": \"Swagger\",\n      \"email\": \"team@swagger.com\"\n    }\n  },\n  \"paths\": {\n    \"/users\": {\n      \"post\": {\n        \"summary\": \"new user\",\n        \"operationId\": \"createUser\",\n        \"requestBody\": {\n          \"required\": true,\n          \"content\": {\n            \"multipart/form-data\": {\n              \"schema\": {\n                \"type\": \"object\",\n                \"properties\": {\n                  \"name\": {\n                    \"type\": \"string\"\n                  },\n                  \"email\": {\n                    \"type\": \"string\"\n                  },\n                  \"avatar\": {\n                    \"type\": \"string\"\n                  },\n                  \"age\": {\n                    \"type\": \"integer\"\n                  }\n                },\n                \"required\": [\n                  \"name\"\n                ]\n              }\n            }\n          }\n        },\n        \"responses\": {\n          \"200\": {\n            \"description\": \"success\",\n            \"content\": {\n              \"application/json\": {\n                \"schema\": {\n                  \"$ref\": \"#/components/schemas/User\"\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  },\n  \"components\": {\n    \"schemas\": {\n      \"User\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"id\": {\n            \"type\": \"integer\"\n          },\n          \"name\": {\n            \"type\": \"string\"\n          },\n          \"email\": {\n            \"type\": \"string\"\n          },\n          \"avatar\": {\n            \"type\": \"string\"\n          },\n          \"age\": {\n            \"type\": \"integer\"\n          }\n        }\n      }\n    }\n  }\n}",
    "packageName": "swagger",
    "hideGenerationTimestamp": true,
    "baseName": "Default",
    "unescapedAppDescription": "API",
    "package": "swagger",
    "imports": [],
    "appName": "API",
    "contextPath": "",
    "appDescription": "API",
    "packageVersion": "1.0.0",
    "generateApiDocs": true,
    "generatorVersion": "3.0.52",
    "releaseNote": "Minor update",
    "version": "1.0.0",
    "gitRepoBaseURL": "https://github.com",
    "modelDocPath": "docs/",
    "basePath": "/",
    "classname": "DefaultApi",
    "gitRepoId": "GIT_REPO_ID",
    "generatedDate": "2024-02-08T14:54:34.443428+08:00[Asia/Shanghai]",
    "infoEmail": "team@swagger.com",
    "templateEngine": "handlebars",
    "gitUserId": "GIT_USER_ID"
  }
]
BruceCham commented 9 months ago

@HugoMario