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] [JAXRS-JERSEY] - Openapi code generation for jaxrs-jersey is not generating xml tags withXml option. #7170

Open
1 task
jothi-prasad opened this issue Aug 9, 2020 · 7 comments

Comments

@jothi-prasad
Copy link

Bug Report Checklist

  • [YES] Have you provided a full/minimal spec to reproduce the issue?
  • [YES] Have you validated the input using an OpenAPI validator (example)?
  • [YES] What's the version of OpenAPI Generator used?
    5.0.0-Beta
  • [YES] Have you search for related issues/PRs?
    YES - [BUG] [GO] can't generate codes with xml tag #4733
  • [YES] What's the actual output vs expected output?
    expecting it to gerenarate XML tags in model classes but it is not.
  • [Optional] Bounty to sponsor the fix (example)
Description

i am trying to generate a jaxrs-jersey server stub with openapi-generator-cli.jar from CLI but the model files are not produced with xml tags.
i need to produce XML content.

iam seeing this exact same issue thats discussed in this ticket #4733
i am not able to generate xml tags with java -jar openapi-generator-cli.jar generate -i ./userapi-1.3.0.yaml --additional-properties withXml=true -g jaxrs-jersey

can you help solve this problem?
i am using https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.0.0-beta/openapi-generator-c...

openapi-generator version

5.0.0-beta

OpenAPI declaration file content or url
Generation Details

i am using the following CLI command
java -jar openapi-generator-cli.jar generate -i ./userapi-1.3.0.yaml --additional-properties withXml=true -g jaxrs-jersey

Steps to reproduce
Related issues/PRs

#4733

Suggest a fix
@auto-labeler
Copy link

auto-labeler bot commented Aug 9, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@wing328
Copy link
Member

wing328 commented Aug 10, 2020

$ grep -R withXml modules/openapi-generator/src/main/resources/JavaJaxRS
modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache:12:{{#withXml}}
modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache:19:{{/withXml}}
modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache:35:{{#withXml}}
modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache:37:{{/withXml}}
modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/xmlPojoAnnotation.mustache:1:{{#withXml}}
modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/xmlPojoAnnotation.mustache:8:{{/withXml}}
modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache:21:{{#withXml}}
modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache:23:{{/withXml}}

Looks like only jaxrs-cxf-ext and jaxrs-cxf generators support the withXml option at the moment.

We can plot XML support to other JAX-RS generators.

@jothi-prasad
Copy link
Author

Thank you @wing328 what does the following line mean?
"We can plot XML support to other JAX-RS generators." - is the support coming soon?

@wing328
Copy link
Member

wing328 commented Aug 11, 2020

As shown above, the {{withXML}} tags are used in JAX-RS cxf-ext, cxf generators. We technically can plot these enhancements to the templates for the JAX-RS jersey1, 2 templates.

Do you have time to contribute the enhancements? I can show you some good starting points.

@jothi-prasad
Copy link
Author

Yeah pls provide some pointers

@mppperez
Copy link

Still facing this issue with 5.1.1. Did anything happened in the meantime and I simply forgot some configuration or dependencies or is this still an open issue?

Any help for a workaround would be appreciated.

@mppperez
Copy link

Ok, after analyzing the existing templates I've simply extended those that were needed in our case (jaxrs-spec) within this PR: #9868

Any help for extending with other implementations like jaxrs-jersey and so on are welcome.

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

3 participants