Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #8890
Closed
Open
Issue created Mar 04, 2021 by Administrator@rootContributor

[BUG] Jaxrs-Jersey produces server that doesn't compile + doesn't handle parent tag in pom.xml correctly

Created by: robbieheywood

Description

I've been testing out openapi-generator but have come up against a few issues, which I've repro'd using the petstore example found at https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/petstore.yaml. I've been trying out server generation by running openapi-generator generate -i petstore.yaml -g jaxrs-jersey -o server, but have encountered the following issues:

  1. After generation, when I run mvn clean package jetty:run as instructed by the generated README, I get the following compilation error:
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] ~/repos/OpenAPI-Specification/examples/v3.0/server/src/gen/java/org/openapitools/api/ApiResponseMessage.java:[3,33] package javax.xml.bind.annotation does not exist
[ERROR] ~/repos/OpenAPI-Specification/examples/v3.0/server/src/gen/java/org/openapitools/api/ApiResponseMessage.java:[5,27] package javax.xml.bind.annotation does not exist
[ERROR] ~/repos/OpenAPI-Specification/examples/v3.0/server/src/gen/java/org/openapitools/api/ApiResponseMessage.java:[45,6] cannot find symbol
  symbol:   class XmlTransient
  location: class org.openapitools.api.ApiResponseMessage
  1. If I run the generation step with openapi-generator generate -i petstore.yaml -g jaxrs-jersey -o server --additional-properties=parentArtifactId=parent-artifact,parentGroupId=parent-group,parentVersion=1.0-SNAPSHOT, then I don't see any parent tag in the generated pom.xml (as expected after reading the docs at https://openapi-generator.tech/docs/generators/jaxrs-jersey/). This is also true with the jaxrs-resteasy generator (where, again, the docs at https://openapi-generator.tech/docs/generators/jaxrs-resteasy/ say it's an available option).
openapi-generator version
> openapi-generator version
5.0.1
OpenAPI declaration file content or url

Repro'd with the petstore example: https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/petstore.yaml

Generation Details

openapi-generator generate -i petstore.yaml -g jaxrs-jersey -o server & openapi-generator generate -i petstore.yaml -g jaxrs-jersey -o server --additional-properties=parentArtifactId=parent-artifact,parentGroupId=parent-group,parentVersion=1.0-SNAPSHOT

Steps to reproduce

Run the above generation commands from inside https://github.com/OAI/OpenAPI-Specification/tree/master/examples/v3.0.

Related issues/PRs

n/a

Suggest a fix

Unsure

Assignee
Assign to
Time tracking