swagger-api / swagger-api/swagger-codegen

[Java*] Ensure cross-language template consistency

Open
#4,937 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

The cross-language consisteny of templates is currently not ensured, leading to low quality over time as features are implemented and not maintained over all languages immediately.

Swagger-codegen version

2.2.3-SNAPSHOT

Related issues

Discussion started in issue #4386

Suggest a Fix

I suggest two ways to go:
a) Use centralized template snippets (mustache lambdas)
b) Ensure consistency by adding Unittests which will track snippets across all languages with opt-out decision. Opt-outs have to be explained in the unittest/template.

IMHO a) would be easier to do as we have only one place to maintain.
b) allows better tracking of changes and is maybe better by not forcing immediate updates cross-languages.

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 reading issue #4386 and reviewing how the cross-language templates are maintained. Compare the centralized Mustache-lambda proposal with the unittest approach, including how opt-outs would be explained; done requires an agreed consistency strategy and a way to track or maintain template changes across languages.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.