swagger-api / swagger-api/swagger-codegen

Output template variables as single JSON

Open
#2,553 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature help wanted
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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.