Open MartinDelVecchio opened 6 years ago
Interestingly, when I added "format: int32" to the integer property definition:
IntProperty:
type: integer
format: int32
summary: An integer property
default: 12345
It worked:
"IntProperty" : {
"type" : "integer",
"format" : "int32",
"default" : 12345
The Swagger spec says that "format" is optional:
An optional format keyword serves as a hint for the tools to use a specific numeric type:
So I don't think it should be required here.
Thanks.
Any interest in addressing this issue?
Thanks.
I am seeing the same issue when generating Java models with swagger-codegen-cli and the JavaClientCodegen, the defaults are not generated for Integer types.
@dankling are you able to get defaults generated for other types? I'm not seeing any of the defaults being generated. Could you post your source and output files?
Same issue here. I'm getting model defaults for boolean types but not integer. using -l csharp and -DdebugModels I'm not seeing "defaultValue" in the output.
Same issue here for python as well.
Two years and two jobs later, circling back to this.
Disappointing to see that it has not been addressed.
Description
I am using swagger-codegen-cli.jar to generate JSON with "-l swagger" from my input YAML. This tool does not include default values specified for integer properties in object types
Swagger-codegen version
2.2.3
Swagger declaration file content or url
Input YAML file:
Command line:
Output JSON: