Skip to content

[Java*] Ensure cross-language template consistency #4937

Open

Description

@jfiala
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.

Activity

  1. jmini commented on Feb 23, 2018

    @jmini
    Contributor

    For version 3, the templating engine is now handlebar.

    A lot of refactoring will be necessary to generate code with the new engine and with the new specification format as input.

    I have the feeling with the current situation, that having a lot of copy paste code in the templates (between several java generators for example) will not make the task easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions