helidon-io / helidon

Java libraries for writing microservices
https://helidon.io
Apache License 2.0
3.48k stars 562 forks source link

OpenAPI generated DTO formatting #8637

Open m0mus opened 5 months ago

m0mus commented 5 months ago

Environment Details

Source code formatting of data transfer objects generated by the OpenAPI generator can be improved.

Spacing and line breaks:

 /**
   * The first name of the pet owner.
   * @return firstName
  **/
  @NotNull
 @Pattern(regexp="^[a-zA-Z]*$") @Size(min=1,max=30)  public String getFirstName() {
    return firstName;
  }

Extra lines:

public OwnerDto(
    @JsonbProperty("id") Integer id, 

    @JsonbProperty("pets") List<PetDto> pets

  ) {
    this.id = id;
    this.pets = pets;
  }
tjquinno commented 4 months ago

We do have a Helidon-specific templates in the artifact openapi-generator named pojo.mustache in the following directories. We can adjust the formatting of these however we want without affecting non-Helidon generators.

main/resources/java-helidon/
  client/
    libraries/
      mp/
      se/
  server/
    libraries/
      mp/
      se/