swagger-api / swagger-api/swagger-codegen
CodegenOperation isMemberPath()
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
CodegenOperation methods isRestfulUpdate and isRestulDestroy has the condition of isMemberPath() which contains this login:
` if (pathParams.size() != 1) return false;
I believe it is valid for a REST call to contain multiple path param: eg. DELETE /org/{myOrg}/user/{myUser} and PATCH /org/{myOrg}/user/{myUser} (valid in my current model)
This is preventing me from properly using the isRestfulUpdate method within a mustache template.
Swagger-codegen version
2.2.1
Suggest a Fix
Remove the isMemberPath() references from the IsRestful* methods, or change condition to have if (pathParams.size() == 0) return false;
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
Locate CodegenOperation and inspect isMemberPath(), isRestfulUpdate(), and isRestulDestroy(); begin by tracing how pathParams is populated. Confirm the behavior through the mustache template that consumes the isRestful* methods, and verify that nested paths such as /org/{myOrg}/user/{myUser} are handled as intended.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100