fix description for parameters in OpenAPI 3#223
Merged
sloria merged 5 commits intomarshmallow-code:devfrom Jun 9, 2018
fMeow:marshmallow
Merged
fix description for parameters in OpenAPI 3#223sloria merged 5 commits intomarshmallow-code:devfrom fMeow:marshmallow
sloria merged 5 commits intomarshmallow-code:devfrom
fMeow:marshmallow
Conversation
Member
|
Thanks again @Guoli-Lyu . Can you add a test for this, too? Once that's added, this can be merged. |
Deprecated and allowEmptyValue keyword is not supported yet. And the better way maybe is to provide different function of schema2fiels for different version, respectively.
Contributor
Author
|
I add test for descriptions in parameters and also requestBody, which in OpenAPI 2 is like this: parameters:
- in: path
name: name |
sloria
reviewed
Jun 9, 2018
Member
sloria
left a comment
There was a problem hiding this comment.
Looks good. Thanks for adding the test. Just some minor revisions to the docs needed. I can make those myself before I merge.
|
|
||
| https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject | ||
|
|
||
| For OpenAPI 3, only "query", "header", "path" or "cookie" is allowed for the location |
Member
There was a problem hiding this comment.
Minor revisions:
For OpenAPI 3, only "query", "header", "path" or "cookie" are allowed for the location of parameters. "requestBody" is used when fields are in the body.
This function always returns a list, with a parameter for each included field in the :class:`Schema <marshmallow.Schema>`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In OpenAPI3, desired output for query parameters is like this:
However, only properties in, name and required are defined in the top level, while all other properties is moved under property schema, which conflicts with OpenAPI 3 specification.
Current output:
So before moving all properties to schema, it's reasonable to check for description property and define description in top level of parameter object.