Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record classes not working correctly in OpenAPI feature #30123

Open
amasson88 opened this issue Nov 11, 2024 · 0 comments
Open

Record classes not working correctly in OpenAPI feature #30123

amasson88 opened this issue Nov 11, 2024 · 0 comments
Labels
in:MicroProfile/OpenAPI Needs member attention release bug This bug is present in a released version of Open Liberty

Comments

@amasson88
Copy link

Describe the bug

Record classes are not working correctly in OpenAPI, in microProfile-6.1 / mpOpenAPI-3.1 (and before).
The implicit getters/fields are ignored.

Steps to Reproduce

Add a record class, use it as some Jakarta Rest response DTO:

public record MyResponse(String name) {}

The openapi yaml (from .../openapi) shows a raw json objectwithout field descriptions:

     MyResponse:
      type: object

Expected behavior

The openapi schema yaml should have info about record fields.

Diagnostic information:

  • OpenLiberty Version: 24.0.0.10
  • Affected feature(s) microProfile-6.1 / mpOpenAPI-3.1
  • Java Version: temurin-21.0.4
  • server.xml configuration
       <feature>microProfile-6.1</feature>

Additional context

Workaround: adding a classic getter getXxxx() in the record class avoids the problem, but it removes one benefit of record.

@amasson88 amasson88 added the release bug This bug is present in a released version of Open Liberty label Nov 11, 2024
@Azquelt Azquelt moved this from New to Backlog in MicroProfile UK Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:MicroProfile/OpenAPI Needs member attention release bug This bug is present in a released version of Open Liberty
Projects
Status: Backlog
Development

No branches or pull requests

3 participants