-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for additionalProperties #18
Comments
I checked it myself - it isn't supported. For us it's a showstopper because we have lots of maps in our API |
Interesting, I didn't see that property shown in the spec of Swagger 2.0. Let's me check how it works. |
Just found I asked similar question in Google Groups.... I tend to provide a partial support on additionalProperties for your case. The problem is, this property contains 2 different types of value: a boolean or a Schema object. The boolean case would be resolved later but not now, is that OK? |
Here is the testing case I would use in this case, let me know if this is not what you expected. {
"swagger":"2.0",
"host":"http://test.com",
"basePath":"/v1",
"paths":{
},
"definitions":{
"Category":{
"properties":{
"id":{
"type":"integer",
"format":"int64"
},
"name":{
"type":"string"
}
}
},
"add_prop":{
"properties":{
"name_of_map":{
"type":"string"
}
},
"additionalProperties":{
"$ref":"#/definitions/Category"
}
}
}
} |
Just to confirm, following JSON should fit your schema: {
"name_of_map": "my map",
"prop1": {
"id": 1,
"name": "property 1"
},
"prop2": {
"id": 2,
"name": "property no. 2"
},
} If so, it's exactly what I need. |
Sure, it will works when inlined. |
Just create a PR, will be merged once we finished your PR. |
Just merge to master, will give a new build once Json_Reference is done. |
Just update a new build on pypi, you could verify this issue with new build. For adding support on type:'number' or 'integer' without format, I gonna provide some way for users to register their own primitive handlers. |
According to OAI/OpenAPI-Specification#38 (comment) swagger 2.0 supports additionalProperties. However i searched the codebase for string 'additionalProperties' and didn't find anything, hence my doubts.
The text was updated successfully, but these errors were encountered: