-
Notifications
You must be signed in to change notification settings - Fork 39
Add new rule: 1050 - ParameterLocationHasChanged
; Change behavior of ChangedParameterOrder
rule with regards to x-ms-parameter-location
#334
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
6621033
ongoing
6914784
add tests for desired param order change behavior
c9d65ed
refactor and document
f417632
bugfix
a1eebb4
ongoing
4d05e1d
ongoing
3975ebe
fix .csproj def
eb3ed79
add comma
09a0678
fix
9dde950
remove obsolete todo
872ec36
refactor
abeb2ec
comment
6f448f3
Merge branch 'main' into users/kojamroz/param_order
266db50
clarify missing behavior and unit tests
415e61c
bugfix
6bcbcc7
add doc for new rule 1050: ParameterLocationHasChanged
9248f5a
add test stub: ParameterLocationChanged
d6b0f3b
WIP: DetectChangedParameterLocation
8784f8d
ongoing
58ecd24
ongoing
34090c9
fixups
cc7fc61
doc update
0814e81
update doc
7aa66e2
fix doc
f671370
better doc
341f76a
add test for removing params
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
67 changes: 67 additions & 0 deletions
67
...modeler/AutoRest.Swagger.Tests/Resource/Swagger/new/global_parameter_no_order_change.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"swagger": 2.0, | ||
"info": { | ||
"title": "required_parameter", | ||
"version": "1.0" | ||
}, | ||
"host": "localhost:8000", | ||
"schemes": [ "http", "https" ], | ||
"paths": { | ||
"/api/Parameters": { | ||
"get": { | ||
"tag": [ "Parameters" ], | ||
"operationId": "Parameters_Get", | ||
"produces": [ | ||
"text/plain" | ||
], | ||
"parameters": [ | ||
{ | ||
"$ref": "#/parameters/MethodLocationParam1" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ClientLocationParam" | ||
}, | ||
{ | ||
"$ref": "#/parameters/MethodLocationParam2" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ImplicitLocationParam" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"parameters": { | ||
"ImplicitLocationParam": { | ||
"name": "implicit_location_param", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "Implicit x-ms-parameter-location param" | ||
}, | ||
"ClientLocationParam": { | ||
"name": "current_location_param", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "client x-ms-parameter-location param", | ||
"x-ms-parameter-location": "client" | ||
}, | ||
"MethodLocationParam1": { | ||
"name": "method_location_param_1", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "method x-ms-parameter-location param 1", | ||
"x-ms-parameter-location": "method" | ||
}, | ||
"MethodLocationParam2": { | ||
"name": "method_location_param_2", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "method x-ms-parameter-location param 2", | ||
"x-ms-parameter-location": "method" | ||
} | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
...rc/modeler/AutoRest.Swagger.Tests/Resource/Swagger/new/global_parameter_order_change.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"swagger": 2.0, | ||
"info": { | ||
"title": "required_parameter", | ||
"version": "1.0" | ||
}, | ||
"host": "localhost:8000", | ||
"schemes": [ "http", "https" ], | ||
"paths": { | ||
"/api/Parameters": { | ||
"get": { | ||
"tag": [ "Parameters" ], | ||
"operationId": "Parameters_Get", | ||
"produces": [ | ||
"text/plain" | ||
], | ||
"parameters": [ | ||
{ | ||
"$ref": "#/parameters/MethodLocationParam2" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ImplicitLocationParam" | ||
}, | ||
{ | ||
"$ref": "#/parameters/MethodLocationParam1" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ClientLocationParam" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"parameters": { | ||
"ImplicitLocationParam": { | ||
"name": "implicit_location_param", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "Implicit x-ms-parameter-location param" | ||
}, | ||
"ClientLocationParam": { | ||
"name": "current_location_param", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "client x-ms-parameter-location param", | ||
"x-ms-parameter-location": "client" | ||
}, | ||
"MethodLocationParam1": { | ||
"name": "method_location_param_1", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "method x-ms-parameter-location param 1", | ||
"x-ms-parameter-location": "method" | ||
}, | ||
"MethodLocationParam2": { | ||
"name": "method_location_param_2", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "method x-ms-parameter-location param 2", | ||
"x-ms-parameter-location": "method" | ||
} | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
...modeler/AutoRest.Swagger.Tests/Resource/Swagger/old/global_parameter_no_order_change.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"swagger": 2.0, | ||
"info": { | ||
"title": "required_parameter", | ||
"version": "1.0" | ||
}, | ||
"host": "localhost:8000", | ||
"schemes": [ "http", "https" ], | ||
"paths": { | ||
"/api/Parameters": { | ||
"get": { | ||
"tag": [ "Parameters" ], | ||
"operationId": "Parameters_Get", | ||
"produces": [ | ||
"text/plain" | ||
], | ||
"parameters": [ | ||
{ | ||
"$ref": "#/parameters/ImplicitLocationParam" | ||
}, | ||
{ | ||
"$ref": "#/parameters/MethodLocationParam1" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ClientLocationParam" | ||
}, | ||
{ | ||
"$ref": "#/parameters/MethodLocationParam2" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"parameters": { | ||
"ImplicitLocationParam": { | ||
"name": "implicit_location_param", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "Implicit x-ms-parameter-location param" | ||
}, | ||
"ClientLocationParam": { | ||
"name": "current_location_param", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "client x-ms-parameter-location param", | ||
"x-ms-parameter-location": "client" | ||
}, | ||
"MethodLocationParam1": { | ||
"name": "method_location_param_1", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "method x-ms-parameter-location param 1", | ||
"x-ms-parameter-location": "method" | ||
}, | ||
"MethodLocationParam2": { | ||
"name": "method_location_param_2", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "method x-ms-parameter-location param 2", | ||
"x-ms-parameter-location": "method" | ||
} | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
...rc/modeler/AutoRest.Swagger.Tests/Resource/Swagger/old/global_parameter_order_change.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"swagger": 2.0, | ||
"info": { | ||
"title": "required_parameter", | ||
"version": "1.0" | ||
}, | ||
"host": "localhost:8000", | ||
"schemes": [ "http", "https" ], | ||
"paths": { | ||
"/api/Parameters": { | ||
"get": { | ||
"tag": [ "Parameters" ], | ||
"operationId": "Parameters_Get", | ||
"produces": [ | ||
"text/plain" | ||
], | ||
"parameters": [ | ||
{ | ||
"$ref": "#/parameters/ImplicitLocationParam" | ||
}, | ||
{ | ||
"$ref": "#/parameters/MethodLocationParam1" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ClientLocationParam" | ||
}, | ||
{ | ||
"$ref": "#/parameters/MethodLocationParam2" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"parameters": { | ||
"ImplicitLocationParam": { | ||
"name": "implicit_location_param", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "Implicit x-ms-parameter-location param" | ||
}, | ||
"ClientLocationParam": { | ||
"name": "current_location_param", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "client x-ms-parameter-location param", | ||
"x-ms-parameter-location": "client" | ||
}, | ||
"MethodLocationParam1": { | ||
"name": "method_location_param_1", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "method x-ms-parameter-location param 1", | ||
"x-ms-parameter-location": "method" | ||
}, | ||
"MethodLocationParam2": { | ||
"name": "method_location_param_2", | ||
"in": "query", | ||
"required": true, | ||
"type": "string", | ||
"description": "method x-ms-parameter-location param 2", | ||
"x-ms-parameter-location": "method" | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.