OpenAPITools / OpenAPITools/openapi-generator

[BUG][JAVA] serializableModel setting causes invalid Java class declaration when set to true

Open
#16,529 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

Using open-apigenerator-maven-plugin with serializableModel set to true causes invalid Java output. Generating java code appends Serializable with a comma on a class. Example:

ClassName extends AbstractOpenApiSchema, Serializable {

In 6.0.0, the Serializable is omitted even if the setting is true.

Expectation is it be declared as:

ClassName extends AbstractOpenApiSchema implements Serializable {

openapi-generator version

Classes were generated okay on 6.0.0, but in 6.0.1 onward to 7.0.0 all failed to create valid Java

OpenAPI declaration file content or url
Generation Details
Steps to reproduce

Set the serializableModel flag to "true"

Related issues/PRs
Suggest a fix

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 by reproducing Java generation with the open-apigenerator-maven-plugin and serializableModel set to true, then inspect the generated class declaration. Compare the output with the expected implements Serializable form and identify the generator entry point responsible; done means generated Java is valid for affected versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.