-
Notifications
You must be signed in to change notification settings - Fork 476
Fix documentation of additionalProperties
field when used with array parameters
#840
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for it @magni-
but please, can you add a note to the UPGRADE.md and add documentation of it to the README.md
All other options are snake-cased rather than camel-cased, so this keeps things consistent.
@LeFnord While working on adding documentation for this, I realized this will need more changes: OAS 2.0 does not support edit: Or maybe it's fine? Testing at https://apitools.dev/swagger-parser/online/, the following is supposedly valid {
"info": {
"title": "title",
"version": "1"
},
"swagger": "2.0",
"paths": {
"/foos": {
"post": {
"parameters": [
{
"in": "body",
"name": "foo",
"schema": {
"$ref": "#/definitions/Foo"
},
"required": true
}
],
"responses": {
"201": {
"description": "desc"
}
},
"operationId": "post-foos"
}
}
},
"definitions": {
"Foo": {
"type": "object",
"additionalProperties": true
}
}
} |
This includes a fix to MoveParams.document_as_property for an issue found while testing these changes.
a04edc6
to
5ef43e2
Compare
I've added documentation to the I also updated the logic so that it behaves more like the rest of |
wow, great work, thank you @magni- … will release it in the next days |
I just noticed Thanks for getting those fixes out @LeFnord ! Could you also release a new version of |
done |
…y parameters (ruby-grape#840) * Fix typo in CHANGELOG * Allow usage of additional_properties, deprecate additionalProperties All other options are snake-cased rather than camel-cased, so this keeps things consistent. * Ignore .byebug_history * Add test covering additional_properties * Fix additionalProperties for arrays of objects * Fix settings additional_properties to false * Handle receiving types and entities in additional_properties This includes a fix to MoveParams.document_as_property for an issue found while testing these changes. * Refactor to use Enumerable#any? * Document additional_properties * Update CHANGELOG
This currently produces invalid Swagger:
I took the liberty of renaming
additionalProperties
toadditional_properties
(and deprecating the former) to have consistent casing.