swagger-api / swagger-api/swagger-parser

Path names are not included in parsed Swagger object

Open
#720 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.