OpenAPITools / OpenAPITools/openapi-generator

[QUESTION][JAVA] Style Guide `google-java-format` for Generated Java Classes

Open
#22,323 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Hello Java committee (and community)!

I would like some clarification surrounding the Style Guide for this project, as mentioned here (google-java-format).

There are many examples of generated Java classes that do not conform to this format. Hence, to what extent should this format be followed? Or, is it considered not worth the effort and it is expected that mvn spotless:apply will be ran on these files anyway?

From personal experience, working on openapi-to-java-records-mustache-templates, it is absolutely possible to better adhere/conform to the google-java-format - with the exception of user-provided values such as class/field names, descriptions, etc.

So, would it be...

  • expected to follow the format?
  • preferred to follow the format?
  • not expected to follow the format?

Thanks in advance 😊

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 with the contributing Style Guide linked in the issue and review the referenced openapi-to-java-records-mustache-templates project for the formatting context. The issue needs a maintainer decision on the expected treatment of generated Java classes before any documentation or template changes can be defined as done.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.