Additional properties (aka map) don't work and, moreover, is not parsed correctly
Closed this issue · 3 comments
I wanted to create one of the fundamental types map[string]string
, but it does not work:
Parameters:
type: map
additionalProperties:
type: string
First of all, I guess it's not correct to define it like this:
AdditionalProperties map[string]*Schema `json:"additionalProperties"`
it should be:
AdditionalProperties *Schema `json:"additionalProperties"`
And also you need to define the map in the scheme.tmpl
Hello @nuttert !
Good catch ! Must be a miss-reading on my side for not implementing it.
I'm currently in a conference, so I may not have the time to fix it right away, but I'll do it as soon as possible.
Thanks for taking the time to read the cause and fill in an issue. It's really appreciated ! If you have any other issues/comments, please do not hesitate.
@nuttert, I'm working on a fix. However, it seems that the "map" type doesn't exists: https://json-schema.org/understanding-json-schema/reference/type
If you try a Json schema validator with the example you provided, it complains about the type. However, if you change it to type: object
, it does work : https://www.jsonschemavalidator.net/s/XS58CpjF
So it should be changed to :
Parameters:
type: object
additionalProperties:
type: string
I'll work on a fix based on that :)