Questions tagged [openapi-generator-maven-plugin]

124 questions
39
votes
4 answers

Is there a way to configure openapi-generator to use jakarta package during generation

I've recently upgraded my project to use spring-boot 3.0.0. So I don't have javax.* modules in the project anymore. But the Open API generator keeps trying to import javax modules. Especially, it uses javax.annotation.Generated for the @Generated…
meldevep
  • 501
  • 1
  • 4
  • 4
4
votes
1 answer

Open API generator allOf not generating model correctly

I want to generate our models based on an Openapi spec 3.0 yml definition. In my spec I have a definition using allOf to include the fields of the other components. When generating the models with the openapi-generator-maven-plugin. I see the…
4
votes
1 answer

How to add basepath in OpenApi so that it is autogenerated with maven?

I have a springboot project in which I have developed an api with OpenApi in yml format and autogenerated the classes with openapi-generator-maven-plugin. The yml is as follows: openapi: 3.0.2 info: version: 0.0.1-SNAPSHOT title: Example…
Paul9999
  • 751
  • 1
  • 11
  • 26
4
votes
1 answer

How to skip generation of ".openapi-generator" folder when using openapi-generator?

I am not able in any way to skip openapi-generator maven plugin version 5.3.0 from generating ".openapi-generator" folder. org.openapitools
3
votes
2 answers

openapi-generator duplicates the endpoint in swagger-ui

The openapi-generator-maven-plugin (version 6.3.0) is configured as follows in a Spring-Boot 3 application: org.openapitools
3
votes
1 answer

Is it possible to add methods to OpenAPI?

I have a question: is it possible to add methods with some logic to DTO, generated by open-api. For example I have an openapi DTO: CarDTO: type: object properties: id: type: string format: uuid isEngineWorks: …
3
votes
1 answer

Openapi-generator-maven-plugin don't generate objects for multipart/form-data request

I am using openapi-generator-maven-plugin for multiple/form-data to upload file with additional data. If I use object (field metadata) in request object wouldn't be generated. For application/json content objects in request are generated. Problem…
3
votes
3 answers

OpenApi enum with multiple values

I am new to OpenApi and want to define my api with an api.yaml (OpenApi version 3.0.1). My problem is the generated enum just contains the name and not the values. This is the enum in my code: TEST1(1, "Test 1", "T1"), TEST2(2, "Test 2",…
3
votes
1 answer

Unable to inherit in OpenAPI 3 using allOf in java

Please find the schemas in my contract yaml file : Foo: allOf: - $ref: "#/components/schemas/Bar" properties: ancestors: items: $ref: "#/components/schemas/Bar" type: array description: type: object …
arunken
  • 415
  • 3
  • 15
3
votes
1 answer

openapi-generator-maven-plugin upgrade openapi spec to 3.1.0

I am using plugin openapi-generator-maven-plugin in version 5.3.1. Upgrading openapi spec from 3.0.3 to 3.1.0 causes generation phase errors: Spec sample: { "openapi": "3.1.0", "info": { "title": "Spec sample", "version": "1.0.0" }, …
iskramac
  • 868
  • 6
  • 14
3
votes
0 answers

OpenAPI V3 Maven Plugin generates incomplete interface code with multiple file upload using multipart/form-data

I am using Openapi V3 with Maven plugin openapi-generator-maven-plugin (5.3.0) for multiple files upload with multipart/form-data. However, the interface code generated is incomplete - missing List declaration in one of the default method (One…
David Yuan
  • 41
  • 2
3
votes
2 answers

How to resolve that openapi-generator-maven-plugin uses deprecated class?

I try to use openapi-generator-maven-plugin together with Spring Boot 2.4.3 to generate code by the specifications made in an openapi.yaml according to some examples on the internet whereby no example provided the complete dependencies necessary to…
du-it
  • 2,561
  • 8
  • 42
  • 80
2
votes
1 answer

Spring Boot OpenAPI generator maven plugin from multiple specs (disable generation of Application class?)

I added the openapi-generator-maven-plugin to my project. Then I saw that by adding two executions in the pom file, I could split api yaml specs into multiple smaller files. This works fine during the generate sources phase, but in the repackage…
2
votes
1 answer

Swagger/OpenApi 3.x composition Vs Inheritance while extending BaseClass when using allOf

Swagger/openAPI is not generating ChildClass with definition having extends ParentClass signature. I am using "org.openapi.generator" version "6.2.1" in my Spring Gradle project. Following is the configuration in my build.gradle generatorName =…
2
votes
1 answer

openapi java generator serializes LocalDate as array instead of full-date

I am using the OpenAPI java generator [1] with library:resttemplate, dateLibrary:java8 in a spring project to generate a client from a spec. For a property in the spec: targetDate: type: string format: date the following…
1
2 3
8 9