Handling path parameters declaration place #77
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.
Closes #64
Done:
Path
object instead ofOperation
Operation
Details:
First, let's compare two specs.
1:
2:
In spec 1 path parameter
id
is declared inside path object and this it how it should be.In spec 2 path the parameter is declared inside operation. Previously we didn't take attention on this, but this declaration is a potential problem. If there are more then one operations for one path, the parameter should be duplicated for each operation. So now we give warning if path parameters are declared in
Operation
, like in spec 2.How to check:
Specs from example above are used in
ParameterTests
.Spec 2 is used in
SwaggerCorrectorTests
to check ifSwaggerCorrector
moves path parameters declared inOperation
toPath