Skip to content

Conversation

@joschi
Copy link
Contributor

@joschi joschi commented Jun 22, 2025

When additionalProperties is set to true, use an additionalProperties attribute and @JsonAnySetter and @JsonAnyGetter annotations instead of extending HashMap.

Refs #20853
Refs #20947

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@bbdouglas @sreeshas @jfiala @lukoyanov @cbornet @jeff9finger @karismann @Zomzog @lwlee2608 @martin-mfg

@wing328
Copy link
Member

wing328 commented Jun 26, 2025

thanks for the PR

do you mind filing a new one based on the latest master?

I think your change was based on master when we were stuck with v7.14.0 release since last Thur.

now the master refers to v7.15.0-SNAPSHOT version

@joschi
Copy link
Contributor Author

joschi commented Jun 28, 2025

do you mind filing a new one based on the latest master?

Done. 😃

@@ -0,0 +1,12 @@
generatorName: java
outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-jackson-mutiny
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about adding this to the github workflow so that it will be tested moving forward?

https://github.com/OpenAPITools/openapi-generator/blob/master/.github/workflows/samples-java-client-jdk11.yaml

sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" complete: ").append(toIndentedString(complete)).append("\n");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we revert these change in the templates to keep the indentation?

@wing328
Copy link
Member

wing328 commented Jul 2, 2025

thanks for the pr

let's give it a try

@wing328 wing328 merged commit 311233d into OpenAPITools:master Jul 2, 2025
93 checks passed
@joschi joschi deleted the issue-20853 branch August 5, 2025 12:59
@wing328 wing328 added this to the 7.15.0 milestone Aug 9, 2025
@xSAVIKx
Copy link

xSAVIKx commented Oct 5, 2025

Hey @wing328, @joschi, isn't this a breaking change? Sometimes it was very desirable to have open-ended hashmap as a super interface for a set of objects.
With the current change one will have to hand-craft a map from the objects.

E.g. we were using it for "config" objects where some of the configurations are known and required (so we want to explicitly document them in the schema), but others' may come in a free-form format.
So now if we migrate to the new generator versions we'll end up with a broken system with no way to easily overcome the change.
Should there be at least an auto-generated method, smth like toMap() to have backward-compatible behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants