swagger-api / swagger-api/swagger-codegen
Output template variables as single JSON
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Currently, when both -DdebugModels and -DdebugOperations are used, template variables are output as separate JSONs.
If they are merged as a single JSON, it would be easier for developers to use their favorite template engines, such as EJS.
Actually, I am having a hard time writing mustache templates to match our own client HTTP library, and I am starting to use EJS.
I am using this modification to accomplish this.
https://github.com/swagger-api/swagger-codegen/compare/master...kenjitayama:singleJSONDebugInfo
For this use case, output would be input for other scripts, not just for debug information.
So maybe an option like --outputTemplateVariables (without needing -DdebugModels and -DdebugOperations) would make more sense.
How do you think of this kind of output?
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 by tracing the -DdebugModels and -DdebugOperations entry points that currently produce separate JSON outputs, then review the linked singleJSONDebugInfo comparison. Determine the desired behavior for a single template-variable JSON and the proposed standalone output option; done means the output is consistently consumable by external template engines.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100