Handling path parameters declaration place#77
Conversation
|
I'm not sure that this is correct behavior. paths:
/user:
get:
summary: Return specific user buy id
parameters:
- name:
required: true
in: path
schema:
type: string
...........
post:
summary: Create new user
...........
delete:
summary: Delete specific user
parameters:
- name:
required: true
in: path
schema:
type: string
...........So I declared CRUD controller in the way when only a part of operations contains Tbh I don't know is it useful, but I guess that we have to mange situation with global parameters as it is - I means we have to add global parameter to each operation, don't we? |
Situation where only a part of operations in service use path parameter is complicated for generation. |
And if I will rewrite it in that way Now it's possible to guess and |
Closes #64
Done:
Pathobject instead ofOperationOperationDetails:
First, let's compare two specs.
1:
2:
In spec 1 path parameter
idis 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
SwaggerCorrectorTeststo check ifSwaggerCorrectormoves path parameters declared inOperationtoPath