-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Open
Labels
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Inner enums lack implements Serializable, while outer/standalone does not.
Discovered here: Chrimle/openapi-to-java-records-mustache-templates#578
Same root cause as #23083
openapi-generator version
7.20.0
OpenAPI declaration file content or url
components:
schemas:
ExampleWithInnerEnums:
type: object
description: Example with inner enum class
properties:
exampleInner:
type: string
description: Example of an inner enum class
enum:
- ENUM1
- ENUM2
- ENUM3Generates:
@JsonAdapter(ExampleInnerEnum.Adapter.class)
public enum ExampleInnerEnum {But should be:
@JsonAdapter(ExampleInnerEnum.Adapter.class)
public enum ExampleInnerEnum implements Serializable {Generation Details
Library: java
serializableModel: true
Steps to reproduce
Related issues/PRs
Suggest a fix
Reactions are currently unavailable