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

[BUG] [JAVA] [openapi-yaml] [spring] wrong generated example text #19063

Open
4 of 6 tasks
kingofdisasterr opened this issue Jul 3, 2024 · 0 comments
Open
4 of 6 tasks

Comments

@kingofdisasterr
Copy link

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • 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

direct usage of allOf destroyes the example of a property with type object without further properties.

expected output (with v7.4.0)

yaml

            example:
              someMeaningfulNumber: 25009779801

java

String exampleString = "{ \"data\" : { \"someMeaningfulNumber\" : 25009779801 }, \"someProperty\" : \"someProperty\" }";

failing output (>7.4.0)

yaml

      example:
        data: "{\"someMeaningfulNumber\":25009779801}"

java

String exampleString = "{ \"data\" : \"{\\"someMeaningfulNumber\\":25009779801}\", \"someProperty\" : \"someProperty\" }";

the generated yaml can't be used for further generation. the generated java code doesn't compile.

openapi-generator version

7.4.0 -> OK
7.5.0 -> fail
7.6.0 -> fail
7.7.0 -> fail

OpenAPI declaration file content or url

https://github.com/kingofdisasterr/openapi-generator-example/blob/main/src/main/resources/yaml/someinterface.yaml

full project:
https://github.com/kingofdisasterr/openapi-generator-example

Generation Details

mvn clean verifyof https://github.com/kingofdisasterr/openapi-generator-example/blob/main/pom.xml

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

No branches or pull requests

1 participant