swagger-api / swagger-api/swagger-parser
Path names are not included in parsed Swagger object
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
If a Swagger 2.0 specification specifies a path that uses path variables, like /foos/{fooId}/bars/{barId}, the resultant Swagger object returned after parsing does not include the original path expression, which we're using to generate code, as we're intentionally ignoring tags and operationIds, plus, some Swagger specifications don't even use tags or operationIds.
This issue requests that the Path object be enhanced to include a name attribute of type String containing the original, unmodified key in the Swagger specification document.
For example, if a Swagger specification specifies
{
// ...
"paths": {
"/foos/{fooId}/bars/{barId}": {
// ...
}
}
}
then the resultant Path object should have a method getName() that returns literally /foos/{fooId}/bars/{barId}.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Java Path object and the Swagger 2.0 parser entry point that processes the paths map. Preserve each path's original key in a name attribute with a getName() method, then verify that /foos/{fooId}/bars/{barId} is returned unchanged by the parsed Swagger object.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100