swagger-typescript-codegen
swagger-typescript-codegen copied to clipboard
Make the implementation follow the OpenAPI/Swagger spec for dictionaries
There are a few valid ways to define additionalProperties
.
To define a dictionary, use
type: object
and use theadditionalProperties
keyword to specify the type of values in key/value pairs.
Instead of using an inline schema, additionalProperties can $ref another schema
If the dictionary values can be of any type (aka free-form object), use additionalProperties: true
https://swagger.io/docs/specification/data-models/dictionaries/
But might be best for the implementation to follow the OpenAPI/Swagger spec, and only allow for valid dictionary types.
Could maybe also handle some of these other invalid cases.
Originally posted by @scottc in https://github.com/mtennoe/swagger-typescript-codegen/pull/63#issuecomment-471845561
@scottc FYI