-
Notifications
You must be signed in to change notification settings - Fork 252
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
Failing test for an api with two different methods but same route. #1486
Closed
Closed
Changes from all commits
Commits
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 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
79 changes: 79 additions & 0 deletions
79
.../Microsoft.OpenApi.Readers.Tests/OpenApiReaderTests/Samples/differentMethodSameRoute.json
This file contains 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,79 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "OpenApi.IntegrationTest", | ||
"version": "1.0" | ||
}, | ||
"paths": { | ||
"/api/v2/someroute/areatype/{index}/{arg}": { | ||
"get": { | ||
"tags": [ | ||
"Test" | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "index", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "integer", | ||
"format": "int64" | ||
} | ||
}, | ||
{ | ||
"name": "arg", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success" | ||
} | ||
} | ||
} | ||
}, | ||
"/api/v2/someroute/areatype/{index}/{language}": { | ||
"put": { | ||
"tags": [ | ||
"Test" | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "index", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "integer", | ||
"format": "int32" | ||
} | ||
}, | ||
{ | ||
"name": "language", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
{ | ||
"name": "text", | ||
"in": "query", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": {} | ||
} |
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.
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.
this snippet is invalid according to the specification
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 the response. Do I understand this correctly that it would be fine if language below would be renamed to arg and regenerated?
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.
sure, but as you do so you'd then have to follow JSON conventions and merge the two nodes.
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.
Of course. I could also include the verb hard coded in the path to keep them seperated.
I guess you're just following the specification, but it makes no sense to me.
Decrease readability or clutter the path. A bit frustrating for something that did pass just fine and now is not, Server handled it well. Clients handled it well. The specification doesn't.
In the end it's just two different endpoints without a direct relation.
Anyways, thanks for your time @baywet to shed some light over the behaviour.