Chrimle / openapi-to-java-records-mustache-templates

Generate Java Records from OpenAPI Specifications
https://chrimle.github.io/openapi-to-java-records-mustache-templates/
Apache License 2.0
3 stars 0 forks source link

Generated `record` classes should override the default `toString()` method #227

Open Chrimle opened 1 day ago

Chrimle commented 1 day ago

Describe the bug Invoking toString() on a generated record returns the default toString() result, inherited from Object.java. However, using openapi-generator would override this method, and output all fields and their corresponding values.

To Reproduce Steps to reproduce the behavior:

  1. Generate any record class.
  2. Invoke toString() on the object
  3. The result is not consistent with typical openapi-generator behaviour

Expected behavior Implement the method similar to how openapi-generator typically does it.

Additional context & Versions used v2.2.0

Chrimle commented 1 day ago

This will be a major (breaking) change...