[REQ] [CORE] Please store primitive schema validations in CodegenModel
Created by: spacether
Is your feature request related to a problem? Please describe.
When a spec with primitive models(type=string/number/integer/boolean) then that model's validations are not included when the model for that type is generated in Java.
Looking at this samples spec:
swagger: '2.0'
info:
description: "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\"
version: 1.0.0
title: OpenAPI Petstore
license:
name: Apache-2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
host: petstore.swagger.io:80
basePath: /v2
tags:
- name: fake
description: A fake api
schemes:
- http
paths:
/fake/StringEnum:
post:
tags:
- fake
description: Test serialization of StringEnum
operationId: StringEnum
parameters:
- name: body
in: body
description: Input string as post body
schema:
$ref: '#/definitions/StringEnum'
responses:
'200':
description: Returned string
schema:
$ref: '#/definitions/StringEnum'
/fake/StringRegex:
post:
tags:
- fake
description: Test serialization of StringRegex
operationId: StringRegex
parameters:
- name: body
in: body
description: Input string as post body
schema:
$ref: '#/definitions/StringRegex'
responses:
'200':
description: Returned string
schema:
$ref: '#/definitions/StringRegex'
/fake/ObjectModelWithRefs:
post:
tags:
- fake
description: Test serialization of ObjectModelWithRefs
operationId: ObjectModelWithRefs
parameters:
- name: body
in: body
description: Input object as post body
schema:
$ref: '#/definitions/ObjectModelWithRefs'
responses:
'200':
description: Returned object
schema:
$ref: '#/definitions/ObjectModelWithRefs'
definitions:
ObjectModelWithRefs:
type: object
required:
- stringEnum
- stringRegex
properties:
stringEnum:
$ref: '#/definitions/StringEnum'
stringRegex:
$ref: '#/definitions/StringRegex'
StringEnum:
type: string
enum:
- "placed"
- "approved"
- "delivered"
StringRegex:
type: string
pattern: '^\d{3}-\d{2}-\d{4}$'
Our produced model will keep the enums in the StringEnum model, but it will discard and not store the pattern in the StringRegex model because we store no validation information in CodegenModel.
Some information on isAlias: we have the flag generateAliasAsModel defined here https://github.com/OpenAPITools/openapi-generator/blob/b69b8cdd31aef20bf41022d84df08bc62aca747e/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java#L314 described as "Generate alias to map, array as models" however some generators also use it to generate models for primitive type. For example the Python generator sets model.isAlias=true for StringRegex when using the Python client generator model.isAlias is turned on if the name of the model is in the typeAliases https://github.com/OpenAPITools/openapi-generator/blob/d7b390f328a597438edd6a72a9f1ff495ca7080a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java#L1695 typeAliases are generated here: https://github.com/OpenAPITools/openapi-generator/blob/d7b390f328a597438edd6a72a9f1ff495ca7080a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java#L1667 Items are added to typeAliases here: https://github.com/OpenAPITools/openapi-generator/blob/d7b390f328a597438edd6a72a9f1ff495ca7080a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java#L3692
Whether or not primitive models have isAlias turned on, having the validation info would let us include it in produced models.
Describe the solution you'd like
The included spec passes validation at https://apitools.dev/swagger-parser/online/ How about we include primitive model validation information in the CodegenModel class. Then we can leave it up to the devs to see if they want to produce models which include this validation info.
Reasons why this would help:
- this information is currently returned to us in the results from the parsed spec but it is being omitted when we generate our java models
- If I as a user define a spec where I get back a StringRegex response, I would expect it to be validated to check that it matches the regex pattern that I defined, but that is not happening
- Because that is not happening I could send an invalid string for StringRegex from the client side
- Because that is not happening the server could send back an invalid string for StringRegex
Spec Information
- Swagger Spec: Definitions stores Schema objects which can be primitives and include format/enum etc https://swagger.io/specification/v2/#schemaObject
- Openapi Spec: Components stores Schema objects which can be primitives and include format/enum etc https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject
Prior Related Work:
- We store enums info at the model level
- allowableValues https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java#L57
- isEnum https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenModel.java#L64
Describe alternatives you've considered
One alternative is to move this primitive schema into a property and load that property into an object model. The python-experimental generator does that but it is overly complicated for a feature that the Swagger and Openapi spec supports.
Additional context
Here is the debug info when using the python generator with -DdebugSupportingFiles The StringRegex model is omitted by the generator
[main] INFO o.o.codegen.DefaultGenerator - ############ Supporting file info ############
{
"licenseUrl" : "http://www.apache.org/licenses/LICENSE-2.0.html",
"appVersion" : "1.0.0",
"generatedYear" : "2019",
"generatorClass" : "org.openapitools.codegen.languages.PythonClientCodegen",
"openAPI" : {
"openapi" : "3.0.1",
"info" : {
"title" : "OpenAPI Petstore",
"description" : "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\",
"license" : {
"name" : "Apache-2.0",
"url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version" : "1.0.0"
},
"servers" : [ {
"url" : "http://petstore.swagger.io:80/v2"
} ],
"tags" : [ {
"name" : "fake",
"description" : "A fake api"
} ],
"paths" : {
"/fake/StringEnum" : {
"post" : {
"tags" : [ "fake" ],
"description" : "Test serialization of StringEnum",
"operationId" : "StringEnum",
"requestBody" : {
"description" : "Input string as post body",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/StringEnum"
}
}
},
"required" : false
},
"responses" : {
"200" : {
"description" : "Returned string",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/StringEnum"
}
}
}
}
},
"x-codegen-request-body-name" : "body"
}
},
"/fake/StringRegex" : {
"post" : {
"tags" : [ "fake" ],
"description" : "Test serialization of StringRegex",
"operationId" : "StringRegex",
"requestBody" : {
"description" : "Input string as post body",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/StringRegex"
}
}
},
"required" : false
},
"responses" : {
"200" : {
"description" : "Returned string",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/StringRegex"
}
}
}
}
},
"x-codegen-request-body-name" : "body"
}
},
"/fake/ObjectModelWithRefs" : {
"post" : {
"tags" : [ "fake" ],
"description" : "Test serialization of ObjectModelWithRefs",
"operationId" : "ObjectModelWithRefs",
"requestBody" : {
"description" : "Input object as post body",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/ObjectModelWithRefs"
}
}
},
"required" : false
},
"responses" : {
"200" : {
"description" : "Returned object",
"content" : {
"*/*" : {
"schema" : {
"$ref" : "#/components/schemas/ObjectModelWithRefs"
}
}
}
}
},
"x-codegen-request-body-name" : "body"
}
}
},
"components" : {
"schemas" : {
"ObjectModelWithRefs" : {
"required" : [ "stringEnum", "stringRegex" ],
"type" : "object",
"properties" : {
"stringEnum" : {
"$ref" : "#/components/schemas/StringEnum"
},
"stringRegex" : {
"pattern" : "^\\d{3}-\\d{2}-\\d{4}$",
"type" : "string"
}
},
"example" : {
"stringRegex" : "stringRegex"
}
},
"StringEnum" : {
"type" : "string",
"enum" : [ "placed", "approved", "delivered" ]
},
"StringRegex" : {
"pattern" : "^\\d{3}-\\d{2}-\\d{4}$",
"type" : "string"
}
}
}
},
"scheme" : "http",
"modelPackage" : "petstore_api.models",
"gitHost" : "github.com",
"templateDir" : "/Users/justin/programming/openapi-generator/modules/openapi-generator/src/main/resources/python",
"apiDocPath" : "docs/",
"licenseInfo" : "Apache-2.0",
"apiFolder" : "petstore_api/api",
"generateApis" : true,
"generateModelDocs" : true,
"generateModelTests" : true,
"basePathWithoutHost" : "/v2",
"generateApiTests" : true,
"lambda" : {
"lowercase" : { },
"uppercase" : { },
"titlecase" : { },
"camelcase" : { },
"indented" : { },
"indented_8" : { },
"indented_12" : { },
"indented_16" : { }
},
"generateModels" : true,
"servers" : [ {
"url" : "http://petstore.swagger.io:80/v2",
"variables" : [ ]
} ],
"inputSpec" : "modules/openapi-generator/src/test/resources/2_0/primitive_models_validations_enums.yaml",
"host" : "petstore.swagger.io",
"packageName" : "petstore_api",
"hideGenerationTimestamp" : true,
"unescapedAppDescription" : "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\",
"models" : [ {
"importPath" : "from petstore_api.models.object_model_with_refs import ObjectModelWithRefs",
"model" : {
"anyOf" : [ ],
"oneOf" : [ ],
"allOf" : [ ],
"name" : "ObjectModelWithRefs",
"classname" : "ObjectModelWithRefs",
"classVarName" : "object_model_with_refs",
"modelJson" : "{\n \"required\" : [ \"stringEnum\", \"stringRegex\" ],\n \"type\" : \"object\",\n \"properties\" : {\n \"stringEnum\" : {\n \"$ref\" : \"#/components/schemas/StringEnum\"\n },\n \"stringRegex\" : {\n \"$ref\" : \"#/components/schemas/StringRegex\"\n }\n }\n}",
"dataType" : "object",
"classFilename" : "object_model_with_refs",
"isAlias" : false,
"isString" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isNumeric" : false,
"isFloat" : false,
"isDouble" : false,
"vars" : [ {
"openApiType" : "StringEnum",
"baseName" : "stringEnum",
"complexType" : "StringEnum",
"getter" : "getStringEnum",
"setter" : "setStringEnum",
"dataType" : "StringEnum",
"datatypeWithEnum" : "StringEnum",
"name" : "string_enum",
"defaultValueWithParam" : " = data.stringEnum;",
"baseType" : "StringEnum",
"example" : "null",
"jsonSchema" : "{\n \"$ref\" : \"#/components/schemas/StringEnum\"\n}",
"exclusiveMinimum" : false,
"exclusiveMaximum" : false,
"hasMore" : true,
"required" : true,
"secondaryParam" : false,
"hasMoreNonReadOnly" : false,
"isPrimitiveType" : false,
"isModel" : false,
"isContainer" : false,
"isString" : false,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isFile" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isEnum" : false,
"isReadOnly" : false,
"isWriteOnly" : false,
"isNullable" : false,
"isSelfReference" : false,
"allowableValues" : {
"enumVars" : [ {
"name" : "PLACED",
"isString" : false,
"value" : "\"placed\""
}, {
"name" : "APPROVED",
"isString" : false,
"value" : "\"approved\""
}, {
"name" : "DELIVERED",
"isString" : false,
"value" : "\"delivered\""
} ],
"values" : [ "placed", "approved", "delivered" ]
},
"vendorExtensions" : { },
"hasValidation" : false,
"isInherited" : false,
"nameInCamelCase" : "StringEnum",
"nameInSnakeCase" : "STRING_ENUM",
"isXmlAttribute" : false,
"isXmlWrapped" : false,
"datatype" : "StringEnum",
"iexclusiveMaximum" : false
}, {
"openApiType" : "string",
"baseName" : "stringRegex",
"getter" : "getStringRegex",
"setter" : "setStringRegex",
"dataType" : "str",
"datatypeWithEnum" : "str",
"name" : "string_regex",
"defaultValueWithParam" : " = data.stringRegex;",
"baseType" : "str",
"pattern" : "/^\\d{3}-\\d{2}-\\d{4}$/",
"example" : "null",
"jsonSchema" : "{\n \"pattern\" : \"^\\\\d{3}-\\\\d{2}-\\\\d{4}$\",\n \"type\" : \"string\"\n}",
"exclusiveMinimum" : false,
"exclusiveMaximum" : false,
"hasMore" : false,
"required" : true,
"secondaryParam" : false,
"hasMoreNonReadOnly" : false,
"isPrimitiveType" : true,
"isModel" : false,
"isContainer" : false,
"isString" : true,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isFile" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isEnum" : false,
"isReadOnly" : false,
"isWriteOnly" : false,
"isNullable" : false,
"isSelfReference" : false,
"vendorExtensions" : {
"x-regex" : "^\\d{3}-\\d{2}-\\d{4}$",
"x-modifiers" : [ ]
},
"hasValidation" : true,
"isInherited" : false,
"nameInCamelCase" : "StringRegex",
"nameInSnakeCase" : "STRING_REGEX",
"isXmlAttribute" : false,
"isXmlWrapped" : false,
"datatype" : "str",
"iexclusiveMaximum" : false
} ],
"allVars" : [ {
"openApiType" : "StringEnum",
"baseName" : "stringEnum",
"complexType" : "StringEnum",
"getter" : "getStringEnum",
"setter" : "setStringEnum",
"dataType" : "StringEnum",
"datatypeWithEnum" : "StringEnum",
"name" : "string_enum",
"defaultValueWithParam" : " = data.stringEnum;",
"baseType" : "StringEnum",
"example" : "null",
"jsonSchema" : "{\n \"$ref\" : \"#/components/schemas/StringEnum\"\n}",
"exclusiveMinimum" : false,
"exclusiveMaximum" : false,
"hasMore" : true,
"required" : true,
"secondaryParam" : false,
"hasMoreNonReadOnly" : false,
"isPrimitiveType" : false,
"isModel" : false,
"isContainer" : false,
"isString" : false,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isFile" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isEnum" : false,
"isReadOnly" : false,
"isWriteOnly" : false,
"isNullable" : false,
"isSelfReference" : false,
"allowableValues" : {
"enumVars" : [ {
"name" : "PLACED",
"isString" : false,
"value" : "\"placed\""
}, {
"name" : "APPROVED",
"isString" : false,
"value" : "\"approved\""
}, {
"name" : "DELIVERED",
"isString" : false,
"value" : "\"delivered\""
} ],
"values" : [ "placed", "approved", "delivered" ]
},
"vendorExtensions" : { },
"hasValidation" : false,
"isInherited" : false,
"nameInCamelCase" : "StringEnum",
"nameInSnakeCase" : "STRING_ENUM",
"isXmlAttribute" : false,
"isXmlWrapped" : false,
"datatype" : "StringEnum",
"iexclusiveMaximum" : false
}, {
"openApiType" : "string",
"baseName" : "stringRegex",
"getter" : "getStringRegex",
"setter" : "setStringRegex",
"dataType" : "str",
"datatypeWithEnum" : "str",
"name" : "string_regex",
"defaultValueWithParam" : " = data.stringRegex;",
"baseType" : "str",
"pattern" : "/^\\d{3}-\\d{2}-\\d{4}$/",
"example" : "null",
"jsonSchema" : "{\n \"pattern\" : \"^\\\\d{3}-\\\\d{2}-\\\\d{4}$\",\n \"type\" : \"string\"\n}",
"exclusiveMinimum" : false,
"exclusiveMaximum" : false,
"hasMore" : false,
"required" : true,
"secondaryParam" : false,
"hasMoreNonReadOnly" : false,
"isPrimitiveType" : true,
"isModel" : false,
"isContainer" : false,
"isString" : true,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isFile" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isEnum" : false,
"isReadOnly" : false,
"isWriteOnly" : false,
"isNullable" : false,
"isSelfReference" : false,
"vendorExtensions" : { },
"hasValidation" : true,
"isInherited" : false,
"nameInCamelCase" : "StringRegex",
"nameInSnakeCase" : "STRING_REGEX",
"isXmlAttribute" : false,
"isXmlWrapped" : false,
"datatype" : "str",
"iexclusiveMaximum" : false
} ],
"requiredVars" : [ {
"openApiType" : "StringEnum",
"baseName" : "stringEnum",
"complexType" : "StringEnum",
"getter" : "getStringEnum",
"setter" : "setStringEnum",
"dataType" : "StringEnum",
"datatypeWithEnum" : "StringEnum",
"name" : "string_enum",
"defaultValueWithParam" : " = data.stringEnum;",
"baseType" : "StringEnum",
"example" : "null",
"jsonSchema" : "{\n \"$ref\" : \"#/components/schemas/StringEnum\"\n}",
"exclusiveMinimum" : false,
"exclusiveMaximum" : false,
"hasMore" : true,
"required" : true,
"secondaryParam" : false,
"hasMoreNonReadOnly" : false,
"isPrimitiveType" : false,
"isModel" : false,
"isContainer" : false,
"isString" : false,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isFile" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isEnum" : false,
"isReadOnly" : false,
"isWriteOnly" : false,
"isNullable" : false,
"isSelfReference" : false,
"allowableValues" : {
"enumVars" : [ {
"name" : "PLACED",
"isString" : false,
"value" : "\"placed\""
}, {
"name" : "APPROVED",
"isString" : false,
"value" : "\"approved\""
}, {
"name" : "DELIVERED",
"isString" : false,
"value" : "\"delivered\""
} ],
"values" : [ "placed", "approved", "delivered" ]
},
"vendorExtensions" : { },
"hasValidation" : false,
"isInherited" : false,
"nameInCamelCase" : "StringEnum",
"nameInSnakeCase" : "STRING_ENUM",
"isXmlAttribute" : false,
"isXmlWrapped" : false,
"datatype" : "StringEnum",
"iexclusiveMaximum" : false
}, {
"openApiType" : "string",
"baseName" : "stringRegex",
"getter" : "getStringRegex",
"setter" : "setStringRegex",
"dataType" : "str",
"datatypeWithEnum" : "str",
"name" : "string_regex",
"defaultValueWithParam" : " = data.stringRegex;",
"baseType" : "str",
"pattern" : "/^\\d{3}-\\d{2}-\\d{4}$/",
"example" : "null",
"jsonSchema" : "{\n \"pattern\" : \"^\\\\d{3}-\\\\d{2}-\\\\d{4}$\",\n \"type\" : \"string\"\n}",
"exclusiveMinimum" : false,
"exclusiveMaximum" : false,
"hasMore" : false,
"required" : true,
"secondaryParam" : false,
"hasMoreNonReadOnly" : false,
"isPrimitiveType" : true,
"isModel" : false,
"isContainer" : false,
"isString" : true,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isFile" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isEnum" : false,
"isReadOnly" : false,
"isWriteOnly" : false,
"isNullable" : false,
"isSelfReference" : false,
"vendorExtensions" : { },
"hasValidation" : true,
"isInherited" : false,
"nameInCamelCase" : "StringRegex",
"nameInSnakeCase" : "STRING_REGEX",
"isXmlAttribute" : false,
"isXmlWrapped" : false,
"datatype" : "str",
"iexclusiveMaximum" : false
} ],
"optionalVars" : [ ],
"readOnlyVars" : [ ],
"readWriteVars" : [ {
"openApiType" : "StringEnum",
"baseName" : "stringEnum",
"complexType" : "StringEnum",
"getter" : "getStringEnum",
"setter" : "setStringEnum",
"dataType" : "StringEnum",
"datatypeWithEnum" : "StringEnum",
"name" : "string_enum",
"defaultValueWithParam" : " = data.stringEnum;",
"baseType" : "StringEnum",
"example" : "null",
"jsonSchema" : "{\n \"$ref\" : \"#/components/schemas/StringEnum\"\n}",
"exclusiveMinimum" : false,
"exclusiveMaximum" : false,
"hasMore" : true,
"required" : true,
"secondaryParam" : false,
"hasMoreNonReadOnly" : false,
"isPrimitiveType" : false,
"isModel" : false,
"isContainer" : false,
"isString" : false,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isFile" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isEnum" : false,
"isReadOnly" : false,
"isWriteOnly" : false,
"isNullable" : false,
"isSelfReference" : false,
"allowableValues" : {
"enumVars" : [ {
"name" : "PLACED",
"isString" : false,
"value" : "\"placed\""
}, {
"name" : "APPROVED",
"isString" : false,
"value" : "\"approved\""
}, {
"name" : "DELIVERED",
"isString" : false,
"value" : "\"delivered\""
} ],
"values" : [ "placed", "approved", "delivered" ]
},
"vendorExtensions" : { },
"hasValidation" : false,
"isInherited" : false,
"nameInCamelCase" : "StringEnum",
"nameInSnakeCase" : "STRING_ENUM",
"isXmlAttribute" : false,
"isXmlWrapped" : false,
"datatype" : "StringEnum",
"iexclusiveMaximum" : false
}, {
"openApiType" : "string",
"baseName" : "stringRegex",
"getter" : "getStringRegex",
"setter" : "setStringRegex",
"dataType" : "str",
"datatypeWithEnum" : "str",
"name" : "string_regex",
"defaultValueWithParam" : " = data.stringRegex;",
"baseType" : "str",
"pattern" : "/^\\d{3}-\\d{2}-\\d{4}$/",
"example" : "null",
"jsonSchema" : "{\n \"pattern\" : \"^\\\\d{3}-\\\\d{2}-\\\\d{4}$\",\n \"type\" : \"string\"\n}",
"exclusiveMinimum" : false,
"exclusiveMaximum" : false,
"hasMore" : false,
"required" : true,
"secondaryParam" : false,
"hasMoreNonReadOnly" : false,
"isPrimitiveType" : true,
"isModel" : false,
"isContainer" : false,
"isString" : true,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isFile" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isEnum" : false,
"isReadOnly" : false,
"isWriteOnly" : false,
"isNullable" : false,
"isSelfReference" : false,
"vendorExtensions" : { },
"hasValidation" : true,
"isInherited" : false,
"nameInCamelCase" : "StringRegex",
"nameInSnakeCase" : "STRING_REGEX",
"isXmlAttribute" : false,
"isXmlWrapped" : false,
"datatype" : "str",
"iexclusiveMaximum" : false
} ],
"parentVars" : [ ],
"mandatory" : [ "string_enum", "string_regex" ],
"allMandatory" : [ "string_enum", "string_regex" ],
"imports" : [ "StringEnum" ],
"hasVars" : true,
"emptyVars" : false,
"hasMoreModels" : true,
"hasEnums" : false,
"isEnum" : false,
"isNullable" : false,
"hasRequired" : true,
"hasOptional" : false,
"isArrayModel" : false,
"hasChildren" : false,
"isMapModel" : false,
"hasOnlyReadOnly" : false,
"vendorExtensions" : { }
}
}, {
"importPath" : "from petstore_api.models.string_enum import StringEnum",
"model" : {
"anyOf" : [ ],
"oneOf" : [ ],
"allOf" : [ ],
"name" : "StringEnum",
"classname" : "StringEnum",
"classVarName" : "string_enum",
"modelJson" : "{\n \"type\" : \"string\",\n \"enum\" : [ \"placed\", \"approved\", \"delivered\" ]\n}",
"dataType" : "str",
"classFilename" : "string_enum",
"isAlias" : false,
"isString" : true,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isNumeric" : false,
"isFloat" : false,
"isDouble" : false,
"vars" : [ ],
"allVars" : [ ],
"requiredVars" : [ ],
"optionalVars" : [ ],
"readOnlyVars" : [ ],
"readWriteVars" : [ ],
"parentVars" : [ ],
"allowableValues" : {
"values" : [ "placed", "approved", "delivered" ],
"enumVars" : [ {
"name" : "PLACED",
"isString" : false,
"value" : "\"placed\""
}, {
"name" : "APPROVED",
"isString" : false,
"value" : "\"approved\""
}, {
"name" : "DELIVERED",
"isString" : false,
"value" : "\"delivered\""
} ]
},
"mandatory" : [ ],
"allMandatory" : [ ],
"imports" : [ ],
"hasVars" : false,
"emptyVars" : true,
"hasMoreModels" : false,
"hasEnums" : false,
"isEnum" : true,
"isNullable" : false,
"hasRequired" : false,
"hasOptional" : false,
"isArrayModel" : false,
"hasChildren" : false,
"isMapModel" : false,
"hasOnlyReadOnly" : true,
"vendorExtensions" : { }
}
} ],
"appName" : "OpenAPI Petstore",
"appDescription" : "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \\\" \\\\",
"contextPath" : "/v2",
"packageVersion" : "1.0.0",
"generateApiDocs" : true,
"generatorVersion" : "4.2.2-SNAPSHOT",
"releaseNote" : "Minor update",
"version" : "1.0.0",
"apiInfo" : {
"apis" : [ {
"appVersion" : "1.0.0",
"generatorClass" : "org.openapitools.codegen.languages.PythonClientCodegen",
"sortParamsByRequiredFlag" : true,
"classVarName" : "fake_api",
"generateModelDocs" : true,
"hasImport" : true,
"generateModelTests" : true,
"strictSpecBehavior" : true,
"generateApiTests" : true,
"classFilename" : "fake_api",
"lambda" : {
"lowercase" : { },
"uppercase" : { },
"titlecase" : { },
"camelcase" : { },
"indented" : { },
"indented_8" : { },
"indented_12" : { },
"indented_16" : { }
},
"generateModels" : true,
"inputSpec" : "modules/openapi-generator/src/test/resources/2_0/primitive_models_validations_enums.yaml",
"baseName" : "fake",
"package" : "petstore_api.api",
"imports" : [ {
"import" : "from petstore_api.models.object_model_with_refs import ObjectModelWithRefs",
"classname" : "ObjectModelWithRefs"
}, {
"import" : "from petstore_api.models.string_enum import StringEnum",
"classname" : "StringEnum"
}, {
"import" : "from petstore_api.models.string_regex import StringRegex",
"classname" : "StringRegex"
} ],
"contextPath" : "/v2",
"appDescription" : "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \\\" \\\\",
"releaseNote" : "Minor update",
"version" : "1.0.0",
"modelDocPath" : "docs/",
"projectName" : "petstore-api",
"importPath" : "petstore_api.api.fake",
"licenseUrl" : "http://www.apache.org/licenses/LICENSE-2.0.html",
"generatedYear" : "2019",
"modelPackage" : "petstore_api.models",
"gitHost" : "github.com",
"templateDir" : "/Users/justin/programming/openapi-generator/modules/openapi-generator/src/main/resources/python",
"apiDocPath" : "docs/",
"licenseInfo" : "Apache-2.0",
"hasModel" : true,
"generateApis" : true,
"basePathWithoutHost" : "/v2",
"operations" : {
"classname" : "FakeApi",
"operation" : [ {
"responseHeaders" : [ ],
"hasAuthMethods" : false,
"hasConsumes" : false,
"hasProduces" : true,
"hasParams" : true,
"hasOptionalParams" : true,
"hasRequiredParams" : false,
"returnTypeIsPrimitive" : false,
"returnSimpleType" : true,
"subresourceOperation" : false,
"isMapContainer" : false,
"isListContainer" : false,
"isMultipart" : false,
"hasMore" : true,
"isResponseBinary" : false,
"isResponseFile" : false,
"hasReference" : true,
"isRestfulIndex" : false,
"isRestfulShow" : false,
"isRestfulCreate" : false,
"isRestfulUpdate" : false,
"isRestfulDestroy" : false,
"isRestful" : false,
"isDeprecated" : false,
"isCallbackRequest" : false,
"path" : "/fake/ObjectModelWithRefs",
"operationId" : "object_model_with_refs",
"returnType" : "ObjectModelWithRefs",
"httpMethod" : "POST",
"returnBaseType" : "ObjectModelWithRefs",
"unescapedNotes" : "Test serialization of ObjectModelWithRefs",
"notes" : "Test serialization of ObjectModelWithRefs",
"baseName" : "fake",
"produces" : [ {
"mediaType" : "*/*"
} ],
"servers" : [ ],
"bodyParam" : {
"isFormParam" : false,
"isQueryParam" : false,
"isPathParam" : false,
"isHeaderParam" : false,
"isCookieParam" : false,
"isBodyParam" : true,
"hasMore" : false,
"isContainer" : false,
"secondaryParam" : false,
"isCollectionFormatMulti" : false,
"isPrimitiveType" : false,
"isModel" : true,
"isExplode" : false,
"baseName" : "body",
"paramName" : "body",
"dataType" : "ObjectModelWithRefs",
"description" : "Input object as post body",
"baseType" : "ObjectModelWithRefs",
"example" : "petstore_api.ObjectModelWithRefs()",
"isString" : false,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isFile" : false,
"isEnum" : false,
"vendorExtensions" : { },
"hasValidation" : false,
"isNullable" : false,
"required" : false,
"exclusiveMaximum" : false,
"exclusiveMinimum" : false,
"uniqueItems" : false
},
"allParams" : [ {
"isFormParam" : false,
"isQueryParam" : false,
"isPathParam" : false,
"isHeaderParam" : false,
"isCookieParam" : false,
"isBodyParam" : true,
"hasMore" : false,
"isContainer" : false,
"secondaryParam" : false,
"isCollectionFormatMulti" : false,
"isPrimitiveType" : false,
"isModel" : true,
"isExplode" : false,
"baseName" : "body",
"paramName" : "body",
"dataType" : "ObjectModelWithRefs",
"description" : "Input object as post body",
"baseType" : "ObjectModelWithRefs",
"example" : "petstore_api.ObjectModelWithRefs()",
"isString" : false,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isFile" : false,
"isEnum" : false,
"vendorExtensions" : { },
"hasValidation" : false,
"isNullable" : false,
"required" : false,
"exclusiveMaximum" : false,
"exclusiveMinimum" : false,
"uniqueItems" : false
} ],
"bodyParams" : [ {
"isFormParam" : false,
"isQueryParam" : false,
"isPathParam" : false,
"isHeaderParam" : false,
"isCookieParam" : false,
"isBodyParam" : true,
"hasMore" : false,
"isContainer" : false,
"secondaryParam" : false,
"isCollectionFormatMulti" : false,
"isPrimitiveType" : false,
"isModel" : true,
"isExplode" : false,
"baseName" : "body",
"paramName" : "body",
"dataType" : "ObjectModelWithRefs",
"description" : "Input object as post body",
"baseType" : "ObjectModelWithRefs",
"example" : "petstore_api.ObjectModelWithRefs()",
"isString" : false,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isFile" : false,
"isEnum" : false,
"vendorExtensions" : { },
"hasValidation" : false,
"isNullable" : false,
"required" : false,
"exclusiveMaximum" : false,
"exclusiveMinimum" : false,
"uniqueItems" : false
} ],
"pathParams" : [ ],
"queryParams" : [ ],
"headerParams" : [ ],
"formParams" : [ ],
"cookieParams" : [ ],
"requiredParams" : [ ],
"optionalParams" : [ {
"isFormParam" : false,
"isQueryParam" : false,
"isPathParam" : false,
"isHeaderParam" : false,
"isCookieParam" : false,
"isBodyParam" : true,
"hasMore" : false,
"isContainer" : false,
"secondaryParam" : false,
"isCollectionFormatMulti" : false,
"isPrimitiveType" : false,
"isModel" : true,
"isExplode" : false,
"baseName" : "body",
"paramName" : "body",
"dataType" : "ObjectModelWithRefs",
"description" : "Input object as post body",
"baseType" : "ObjectModelWithRefs",
"example" : "petstore_api.ObjectModelWithRefs()",
"isString" : false,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isFile" : false,
"isEnum" : false,
"vendorExtensions" : { },
"hasValidation" : false,
"isNullable" : false,
"required" : false,
"exclusiveMaximum" : false,
"exclusiveMinimum" : false,
"uniqueItems" : false
} ],
"tags" : [ {
"name" : "fake",
"description" : "A fake api"
} ],
"responses" : [ {
"headers" : [ ],
"code" : "200",
"message" : "Returned object",
"hasMore" : false,
"dataType" : "ObjectModelWithRefs",
"baseType" : "ObjectModelWithRefs",
"hasHeaders" : false,
"isString" : false,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isEmail" : false,
"isModel" : true,
"isFreeFormObject" : false,
"isDefault" : true,
"simpleType" : true,
"primitiveType" : false,
"isMapContainer" : false,
"isListContainer" : false,
"isBinary" : false,
"isFile" : false,
"schema" : {
"$ref" : "#/components/schemas/ObjectModelWithRefs"
},
"jsonSchema" : "{\n \"description\" : \"Returned object\",\n \"content\" : {\n \"*/*\" : {\n \"schema\" : {\n \"$ref\" : \"#/components/schemas/ObjectModelWithRefs\"\n }\n }\n }\n}",
"vendorExtensions" : { },
"wildcard" : false
} ],
"callbacks" : [ ],
"imports" : [ "ObjectModelWithRefs" ],
"examples" : [ {
"contentType" : "*/*",
"example" : "{\n \"stringRegex\" : \"stringRegex\"\n}",
"statusCode" : "200"
} ],
"requestBodyExamples" : [ {
"contentType" : "*/*",
"example" : "{\n \"stringRegex\" : \"stringRegex\"\n}"
} ],
"vendorExtensions" : {
"x-codegen-request-body-name" : "body"
},
"nickname" : "object_model_with_refs",
"operationIdOriginal" : "ObjectModelWithRefs",
"operationIdLowerCase" : "object_model_with_refs",
"operationIdCamelCase" : "ObjectModelWithRefs",
"operationIdSnakeCase" : "object_model_with_refs",
"restfulShow" : false,
"restfulIndex" : false,
"restfulCreate" : false,
"restfulUpdate" : false,
"restfulDestroy" : false,
"restful" : false,
"hasQueryParams" : false,
"hasHeaderParams" : false,
"hasCookieParams" : false,
"hasResponseHeaders" : false,
"bodyAllowed" : true,
"hasExamples" : true,
"hasBodyParam" : true,
"hasFormParams" : false,
"hasPathParams" : false
}, {
"responseHeaders" : [ ],
"hasAuthMethods" : false,
"hasConsumes" : false,
"hasProduces" : true,
"hasParams" : true,
"hasOptionalParams" : true,
"hasRequiredParams" : false,
"returnTypeIsPrimitive" : false,
"returnSimpleType" : true,
"subresourceOperation" : false,
"isMapContainer" : false,
"isListContainer" : false,
"isMultipart" : false,
"hasMore" : true,
"isResponseBinary" : false,
"isResponseFile" : false,
"hasReference" : true,
"isRestfulIndex" : false,
"isRestfulShow" : false,
"isRestfulCreate" : false,
"isRestfulUpdate" : false,
"isRestfulDestroy" : false,
"isRestful" : false,
"isDeprecated" : false,
"isCallbackRequest" : false,
"path" : "/fake/StringEnum",
"operationId" : "string_enum",
"returnType" : "StringEnum",
"httpMethod" : "POST",
"returnBaseType" : "StringEnum",
"unescapedNotes" : "Test serialization of StringEnum",
"notes" : "Test serialization of StringEnum",
"baseName" : "fake",
"produces" : [ {
"mediaType" : "*/*"
} ],
"servers" : [ ],
"bodyParam" : {
"isFormParam" : false,
"isQueryParam" : false,
"isPathParam" : false,
"isHeaderParam" : false,
"isCookieParam" : false,
"isBodyParam" : true,
"hasMore" : false,
"isContainer" : false,
"secondaryParam" : false,
"isCollectionFormatMulti" : false,
"isPrimitiveType" : true,
"isModel" : false,
"isExplode" : false,
"baseName" : "body",
"paramName" : "body",
"dataType" : "str",
"description" : "Input string as post body",
"baseType" : "str",
"example" : "'body_example'",
"isString" : true,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isFile" : false,
"isEnum" : false,
"vendorExtensions" : { },
"hasValidation" : false,
"isNullable" : false,
"required" : false,
"exclusiveMaximum" : false,
"exclusiveMinimum" : false,
"uniqueItems" : false
},
"allParams" : [ {
"isFormParam" : false,
"isQueryParam" : false,
"isPathParam" : false,
"isHeaderParam" : false,
"isCookieParam" : false,
"isBodyParam" : true,
"hasMore" : false,
"isContainer" : false,
"secondaryParam" : false,
"isCollectionFormatMulti" : false,
"isPrimitiveType" : true,
"isModel" : false,
"isExplode" : false,
"baseName" : "body",
"paramName" : "body",
"dataType" : "str",
"description" : "Input string as post body",
"baseType" : "str",
"example" : "'body_example'",
"isString" : true,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isFile" : false,
"isEnum" : false,
"vendorExtensions" : { },
"hasValidation" : false,
"isNullable" : false,
"required" : false,
"exclusiveMaximum" : false,
"exclusiveMinimum" : false,
"uniqueItems" : false
} ],
"bodyParams" : [ {
"isFormParam" : false,
"isQueryParam" : false,
"isPathParam" : false,
"isHeaderParam" : false,
"isCookieParam" : false,
"isBodyParam" : true,
"hasMore" : false,
"isContainer" : false,
"secondaryParam" : false,
"isCollectionFormatMulti" : false,
"isPrimitiveType" : true,
"isModel" : false,
"isExplode" : false,
"baseName" : "body",
"paramName" : "body",
"dataType" : "str",
"description" : "Input string as post body",
"baseType" : "str",
"example" : "'body_example'",
"isString" : true,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isFile" : false,
"isEnum" : false,
"vendorExtensions" : { },
"hasValidation" : false,
"isNullable" : false,
"required" : false,
"exclusiveMaximum" : false,
"exclusiveMinimum" : false,
"uniqueItems" : false
} ],
"pathParams" : [ ],
"queryParams" : [ ],
"headerParams" : [ ],
"formParams" : [ ],
"cookieParams" : [ ],
"requiredParams" : [ ],
"optionalParams" : [ {
"isFormParam" : false,
"isQueryParam" : false,
"isPathParam" : false,
"isHeaderParam" : false,
"isCookieParam" : false,
"isBodyParam" : true,
"hasMore" : false,
"isContainer" : false,
"secondaryParam" : false,
"isCollectionFormatMulti" : false,
"isPrimitiveType" : true,
"isModel" : false,
"isExplode" : false,
"baseName" : "body",
"paramName" : "body",
"dataType" : "str",
"description" : "Input string as post body",
"baseType" : "str",
"example" : "'body_example'",
"isString" : true,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isFile" : false,
"isEnum" : false,
"vendorExtensions" : { },
"hasValidation" : false,
"isNullable" : false,
"required" : false,
"exclusiveMaximum" : false,
"exclusiveMinimum" : false,
"uniqueItems" : false
} ],
"tags" : [ {
"name" : "fake",
"description" : "A fake api"
} ],
"responses" : [ {
"headers" : [ ],
"code" : "200",
"message" : "Returned string",
"hasMore" : false,
"dataType" : "StringEnum",
"baseType" : "StringEnum",
"hasHeaders" : false,
"isString" : false,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isEmail" : false,
"isModel" : true,
"isFreeFormObject" : false,
"isDefault" : true,
"simpleType" : true,
"primitiveType" : false,
"isMapContainer" : false,
"isListContainer" : false,
"isBinary" : false,
"isFile" : false,
"schema" : {
"$ref" : "#/components/schemas/StringEnum"
},
"jsonSchema" : "{\n \"description\" : \"Returned string\",\n \"content\" : {\n \"*/*\" : {\n \"schema\" : {\n \"$ref\" : \"#/components/schemas/StringEnum\"\n }\n }\n }\n}",
"vendorExtensions" : { },
"wildcard" : false
} ],
"callbacks" : [ ],
"imports" : [ "StringEnum" ],
"examples" : [ {
"contentType" : "*/*",
"example" : "null",
"statusCode" : "200"
} ],
"requestBodyExamples" : [ {
"output" : "none"
} ],
"vendorExtensions" : {
"x-codegen-request-body-name" : "body"
},
"nickname" : "string_enum",
"operationIdOriginal" : "StringEnum",
"operationIdLowerCase" : "string_enum",
"operationIdCamelCase" : "StringEnum",
"operationIdSnakeCase" : "string_enum",
"restfulShow" : false,
"restfulIndex" : false,
"restfulCreate" : false,
"restfulUpdate" : false,
"restfulDestroy" : false,
"restful" : false,
"hasQueryParams" : false,
"hasHeaderParams" : false,
"hasCookieParams" : false,
"hasResponseHeaders" : false,
"bodyAllowed" : true,
"hasExamples" : true,
"hasBodyParam" : true,
"hasFormParams" : false,
"hasPathParams" : false
}, {
"responseHeaders" : [ ],
"hasAuthMethods" : false,
"hasConsumes" : false,
"hasProduces" : true,
"hasParams" : true,
"hasOptionalParams" : true,
"hasRequiredParams" : false,
"returnTypeIsPrimitive" : true,
"returnSimpleType" : true,
"subresourceOperation" : false,
"isMapContainer" : false,
"isListContainer" : false,
"isMultipart" : false,
"hasMore" : false,
"isResponseBinary" : false,
"isResponseFile" : false,
"hasReference" : false,
"isRestfulIndex" : false,
"isRestfulShow" : false,
"isRestfulCreate" : false,
"isRestfulUpdate" : false,
"isRestfulDestroy" : false,
"isRestful" : false,
"isDeprecated" : false,
"isCallbackRequest" : false,
"path" : "/fake/StringRegex",
"operationId" : "string_regex",
"returnType" : "str",
"httpMethod" : "POST",
"returnBaseType" : "str",
"unescapedNotes" : "Test serialization of StringRegex",
"notes" : "Test serialization of StringRegex",
"baseName" : "fake",
"produces" : [ {
"mediaType" : "*/*"
} ],
"servers" : [ ],
"bodyParam" : {
"isFormParam" : false,
"isQueryParam" : false,
"isPathParam" : false,
"isHeaderParam" : false,
"isCookieParam" : false,
"isBodyParam" : true,
"hasMore" : false,
"isContainer" : false,
"secondaryParam" : false,
"isCollectionFormatMulti" : false,
"isPrimitiveType" : true,
"isModel" : true,
"isExplode" : false,
"baseName" : "body",
"paramName" : "body",
"dataType" : "StringRegex",
"description" : "Input string as post body",
"baseType" : "StringRegex",
"example" : "petstore_api.StringRegex()",
"isString" : true,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isFile" : false,
"isEnum" : false,
"vendorExtensions" : {
"x-regex" : "^\\d{3}-\\d{2}-\\d{4}$",
"x-modifiers" : [ ]
},
"hasValidation" : false,
"isNullable" : false,
"required" : false,
"exclusiveMaximum" : false,
"exclusiveMinimum" : false,
"pattern" : "/^\\d{3}-\\d{2}-\\d{4}$/",
"uniqueItems" : false
},
"allParams" : [ {
"isFormParam" : false,
"isQueryParam" : false,
"isPathParam" : false,
"isHeaderParam" : false,
"isCookieParam" : false,
"isBodyParam" : true,
"hasMore" : false,
"isContainer" : false,
"secondaryParam" : false,
"isCollectionFormatMulti" : false,
"isPrimitiveType" : true,
"isModel" : true,
"isExplode" : false,
"baseName" : "body",
"paramName" : "body",
"dataType" : "StringRegex",
"description" : "Input string as post body",
"baseType" : "StringRegex",
"example" : "petstore_api.StringRegex()",
"isString" : true,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isFile" : false,
"isEnum" : false,
"vendorExtensions" : {
"x-regex" : "^\\d{3}-\\d{2}-\\d{4}$",
"x-modifiers" : [ ]
},
"hasValidation" : false,
"isNullable" : false,
"required" : false,
"exclusiveMaximum" : false,
"exclusiveMinimum" : false,
"pattern" : "/^\\d{3}-\\d{2}-\\d{4}$/",
"uniqueItems" : false
} ],
"bodyParams" : [ {
"isFormParam" : false,
"isQueryParam" : false,
"isPathParam" : false,
"isHeaderParam" : false,
"isCookieParam" : false,
"isBodyParam" : true,
"hasMore" : false,
"isContainer" : false,
"secondaryParam" : false,
"isCollectionFormatMulti" : false,
"isPrimitiveType" : true,
"isModel" : true,
"isExplode" : false,
"baseName" : "body",
"paramName" : "body",
"dataType" : "StringRegex",
"description" : "Input string as post body",
"baseType" : "StringRegex",
"example" : "petstore_api.StringRegex()",
"isString" : true,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isFile" : false,
"isEnum" : false,
"vendorExtensions" : {
"x-regex" : "^\\d{3}-\\d{2}-\\d{4}$",
"x-modifiers" : [ ]
},
"hasValidation" : false,
"isNullable" : false,
"required" : false,
"exclusiveMaximum" : false,
"exclusiveMinimum" : false,
"pattern" : "/^\\d{3}-\\d{2}-\\d{4}$/",
"uniqueItems" : false
} ],
"pathParams" : [ ],
"queryParams" : [ ],
"headerParams" : [ ],
"formParams" : [ ],
"cookieParams" : [ ],
"requiredParams" : [ ],
"optionalParams" : [ {
"isFormParam" : false,
"isQueryParam" : false,
"isPathParam" : false,
"isHeaderParam" : false,
"isCookieParam" : false,
"isBodyParam" : true,
"hasMore" : false,
"isContainer" : false,
"secondaryParam" : false,
"isCollectionFormatMulti" : false,
"isPrimitiveType" : true,
"isModel" : true,
"isExplode" : false,
"baseName" : "body",
"paramName" : "body",
"dataType" : "StringRegex",
"description" : "Input string as post body",
"baseType" : "StringRegex",
"example" : "petstore_api.StringRegex()",
"isString" : true,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBinary" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isUri" : false,
"isEmail" : false,
"isFreeFormObject" : false,
"isListContainer" : false,
"isMapContainer" : false,
"isFile" : false,
"isEnum" : false,
"vendorExtensions" : {
"x-regex" : "^\\d{3}-\\d{2}-\\d{4}$",
"x-modifiers" : [ ]
},
"hasValidation" : false,
"isNullable" : false,
"required" : false,
"exclusiveMaximum" : false,
"exclusiveMinimum" : false,
"pattern" : "/^\\d{3}-\\d{2}-\\d{4}$/",
"uniqueItems" : false
} ],
"tags" : [ {
"name" : "fake",
"description" : "A fake api"
} ],
"responses" : [ {
"headers" : [ ],
"code" : "200",
"message" : "Returned string",
"hasMore" : false,
"dataType" : "str",
"baseType" : "str",
"hasHeaders" : false,
"isString" : true,
"isNumeric" : false,
"isInteger" : false,
"isLong" : false,
"isNumber" : false,
"isFloat" : false,
"isDouble" : false,
"isByteArray" : false,
"isBoolean" : false,
"isDate" : false,
"isDateTime" : false,
"isUuid" : false,
"isEmail" : false,
"isModel" : false,
"isFreeFormObject" : false,
"isDefault" : true,
"simpleType" : true,
"primitiveType" : true,
"isMapContainer" : false,
"isListContainer" : false,
"isBinary" : false,
"isFile" : false,
"schema" : {
"pattern" : "^\\d{3}-\\d{2}-\\d{4}$",
"type" : "string"
},
"jsonSchema" : "{\n \"description\" : \"Returned string\",\n \"content\" : {\n \"*/*\" : {\n \"schema\" : {\n \"$ref\" : \"#/components/schemas/StringRegex\"\n }\n }\n }\n}",
"vendorExtensions" : { },
"wildcard" : false
} ],
"callbacks" : [ ],
"imports" : [ "StringRegex" ],
"requestBodyExamples" : [ {
"contentType" : "*/*",
"example" : "null"
} ],
"vendorExtensions" : {
"x-codegen-request-body-name" : "body"
},
"nickname" : "string_regex",
"operationIdOriginal" : "StringRegex",
"operationIdLowerCase" : "string_regex",
"operationIdCamelCase" : "StringRegex",
"operationIdSnakeCase" : "string_regex",
"restfulShow" : false,
"restfulIndex" : false,
"restfulCreate" : false,
"restfulUpdate" : false,
"restfulDestroy" : false,
"restful" : false,
"hasQueryParams" : false,
"hasHeaderParams" : false,
"hasCookieParams" : false,
"hasResponseHeaders" : false,
"bodyAllowed" : true,
"hasExamples" : false,
"hasBodyParam" : true,
"hasFormParams" : false,
"hasPathParams" : false
} ],
"pathPrefix" : "fake_api"
},
"packageName" : "petstore_api",
"hideGenerationTimestamp" : true,
"unescapedAppDescription" : "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\",
"appName" : "OpenAPI Petstore",
"packageVersion" : "1.0.0",
"generateApiDocs" : true,
"generatorVersion" : "4.2.2-SNAPSHOT",
"apiPackage" : "petstore_api.api",
"basePath" : "http://petstore.swagger.io:80/v2",
"classname" : "FakeApi",
"gitRepoId" : "GIT_REPO_ID",
"generatedDate" : "2019-11-30T09:05:21.413-08:00[America/Los_Angeles]",
"appDescriptionWithNewLines" : "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \\\" \\\\",
"generateAliasAsModel" : "true",
"gitUserId" : "GIT_USER_ID"
} ]
},
"apiPackage" : "petstore_api.api",
"hasServers" : true,
"modelDocPath" : "docs/",
"basePath" : "http://petstore.swagger.io:80/v2",
"gitRepoId" : "GIT_REPO_ID",
"generatedDate" : "2019-11-30T09:05:21.413-08:00[America/Los_Angeles]",
"appDescriptionWithNewLines" : "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \\\" \\\\",
"generateAliasAsModel" : "true",
"projectName" : "petstore-api",
"gitUserId" : "GIT_USER_ID"
}
Core Team @wing328 (2015/07) @jimschubert (2016/05) @cbornet (2016/05) @ackintosh (2018/02) @jmini (2018/04) @etherealjoy (2019/06)
Java Team @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10)