OpenAPITools / OpenAPITools/openapi-generator

[BUG] Issue with Additional Properties backward compatibility

Open
#7,970 0 comments 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

Version 4.x

To maintain backward compatibility with additional-properties there is check here
if (additionalProperties == null && configOptions.containsKey("additional-properties")) {

additionalProperties list is defined as maven parameter above

@Parameter(name = "additionalProperties", property = "openapi.generator.maven.plugin.additionalProperties")
    private List<String> additionalProperties;

Maven engine always initializes this list to be empty list. Because of this condition given above is never true. This creates a problem to maintain backward compatibility

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 in modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java around line 650, and read the additionalProperties Maven parameter declaration above it. Verify how Maven initializes the list and how the backward-compatibility condition handles an empty list versus an absent value. Done means the legacy additional-properties behavior is preserved when the Maven parameter is initialized empty.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
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.