OpenAPITools / OpenAPITools/openapi-generator
[BUG] Description
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Hi I have been successful in creating models and server code using openapi-generator, so far everything is working well. However, I wanted to introduce @JsonIgnoreProperties to my generated models and came across this page which was talking about introducing library tag as jersey2. I tried this, in my spring boot application and it continues to give the following error:
java.lang.RuntimeException: Unknown library: jersey2
Available libraries:
spring-boot
spring-mvc
spring-cloud
I also tried adding the jersey2 client and jackson library as per the example here, but I continued to see the above error.
spring-boot version: 2.2.7
openapi-generator version: 4.3.0
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>${openapi-generator-version}</version>
<executions>
<execution>
<id>generate-client-jar</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>src/main/resources/api.yaml</inputSpec>
<generatorName>spring</generatorName>
<configOptions>
<sourceFolder>src/gen/java/main</sourceFolder>
<apiPackage>${openapi-gen.api.package}</apiPackage>
<modelPackage>${openapi-gen.model.package}</modelPackage>
<useTags>true</useTags>
<dateLibrary>java8</dateLibrary>
<interfaceOnly>true</interfaceOnly>
<delegatePattern>true</delegatePattern>
<unhandledException>true</unhandledException>
</configOptions>
<library>jersey2</library>
</configuration>
</execution>
</executions>
</plugin>
I am not sure if I am providing the right configuration, I would very appreciate if you could point me in the right direction. Cheers!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the spring generator configuration in the Maven plugin snippet and compare its supported libraries with modules/openapi-generator-maven-plugin/examples/java-client.xml. Reproduce the Unknown library: jersey2 error using the reported openapi-generator 4.3.0 setup, then verify the configuration accepts the intended library or clearly reports the supported alternative.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- api, backend, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100