Open dganoff opened 7 years ago
@dganoff What about not specifying "default": null
as the default should already be null, right?
I remember there's a discussion about null
value (default or example) before and the recommended approach is to use vendor extension to indicate the null value as default/example values are treated as string ("null")
@wing328 Thanks for the feedback! I will advocate that we do away with null
default values since you make a good point that they are not helpful. I'll also look into the vendor extension which sounds interesting.
I'll also look into the vendor extension which sounds interesting.
@dganoff We've not implemented it yet. I can show you some good starting point to add it to JS client templates.
Description
Model default value of
null
for strings gets set to"null"
upon creating anew
instance of the model.Swagger-codegen version
2.3.0
Swagger declaration file content or url
Schema definition for the model property:
Command line used for generation
Steps to reproduce
let connection = new moduleName.Connection();
connection.outbound_localization
value is"null"
Suggest a fix/enhancement
I suggest that if the default value for a model property is
null
, then set the value tonull
regardless of the propertytype
. Otherwise keep it asundefined
.