Questions tagged [openapi-generator]

An open-source tool to generate API clients, server stubs, documentation and more given an OpenAPI Spec (v2, v3)

OpenAPI Generator is an open-source tool that allows generation of API client libraries, server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3). Many companies are using it in production. Below please find a list of generators included in the project:

API clients: ActionScript, Ada, Apex, Bash, C# (.net 2.0, 3.5 or later), C++ (cpprest, Qt5, Tizen), Clojure, Dart, Elixir, Elm, Eiffel, Erlang, Go, Groovy, Haskell (http-client, Servant), Java (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured), Kotlin, Lua, Node.js (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types) Objective-C, Perl, PHP, PowerShell, Python, R, Ruby, Rust (rust, rust-server), Scala (akka, http4s, scalaz, swagger-async-httpclient), Swift (2.x, 3.x, 4.x), Typescript (AngularJS, Angular (2.x - 6.x), Aurelia, Fetch, Inversify, jQuery, Node)

Server stubs: Ada, C# (ASP.NET Core, NancyFx), C++ (Pistache, Restbed), Erlang, Go, Haskell (Servant), Java (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, PKMST), Kotlin, PHP (Lumen, Slim, Silex, Symfony, Zend Expressive), Python (Flask), NodeJS, Ruby (Sinatra, Rails5), Rust (rust-server), Scala (Finch, Lagom, Scalatra)

API documentation generators: HTML, Confluence Wiki

Configuration files: Apache2

Others: JMeter

1021 questions
74
votes
3 answers

Convert OpenAPI 3.0 to Swagger 2.0

Is there a generator to convert OpenAPI 3.0 to Swagger 2.0? Mashery, an API gateway, requires Swagger 2.0 format on input to open endpoint.
Michal Foksa
  • 11,225
  • 9
  • 50
  • 68
46
votes
3 answers

openapi tools generator vs swagger codegen

I am lost in dependencies and tools: I previously use the following tool to generate code for my swagger…
bvdb
  • 22,839
  • 10
  • 110
  • 123
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
33
votes
5 answers

Use java.time.Instant to represent DateTime instead of OffsetDateTime

I'm using the openApi maven plugin to generate java request/responses for a REST api. The request has a DateTime property, when I run the generator I get the DateTime property of the attribute represented as java.time.OffsetDateTime. The problem is…
sromdhane
  • 375
  • 1
  • 4
  • 7
31
votes
4 answers

How to use OpenAPI "oneOf" property with openapi-generator-maven-plugin when generating Spring code

I am developing an application with an Angular frontend and RESTful Spring Boot Backend I found this very handy maven plugin openapi-generator-maven-plugin from org.openapitools. With its code generation capability, it helps enforce a "contract…
CeeTee
  • 778
  • 1
  • 9
  • 17
27
votes
2 answers

Swagger Codegen (with maven plugin) for OpenAPI 3.0

I want to use Swagger Codegen for OpenAPI 3.0 YAML file. And I see Swagger Codegen 3.0.0-rc0 is available. But when I try to use that I run into issues. Following are the details: My pom.xml file with swagger-codegen plugin:
Kuldeep Jain
  • 8,409
  • 8
  • 48
  • 73
22
votes
5 answers

openapi springboot generator jackson no String-argument constructor/factory method to deserialize from String value

I'm using OpenApi SpringBoot generator to generate controller interfaces and models. This creates model classes with JsonNullable for nullable fields. However I'm getting a Jackson type definition error while POST request is sent with value…
20
votes
3 answers

Generating POJOs using OpenAPI generator with Lombok Annotations

I am using OpenAPI generator maven plugin like one below for generating Java client code for models . org.openapitools openapi-generator-maven-plugin 4.3.1
Saurabh Chaturvedi
  • 2,028
  • 2
  • 18
  • 39
20
votes
4 answers

How to skip generation of support and metadata files with openAPI Generator and Maven?

I'm converting a swagger file into an open API v3 one using the openapi-yaml generator with Maven. What I would like to do is to put the new file directly into some directory. However some additional files are generated which I don't need e.g.…
Admit
  • 4,897
  • 4
  • 18
  • 26
18
votes
5 answers

What is the function of springdoc-openapi-maven-plugin configuration/apiDocsUrl?

I'm running the springdoc-openapi-maven-plugin, with the following (standard) configuration: org.springdoc springdoc-openapi-maven-plugin
KevinB
  • 1,102
  • 2
  • 8
  • 19
17
votes
1 answer

How to define byte array in OpenAPI 3.0

I'm migrating my API from Swagger 2.0 to OpenAPI 3.0. In a DTO I have a field specified as a byte array. Swagger definition of the DTO: Job: type: object properties: body: type: string format: binary Using the…
Michael Dz
  • 3,655
  • 8
  • 40
  • 74
16
votes
2 answers

Significance of Delegate Design Pattern in Swagger Generated Code?

When i generate code for Spring from my swagger yaml , usually controller layer is generated using delegate pattern , such that for a single model three files are generated . For example , if i defined a model named Person in my swagger/open API…
Saurabh Chaturvedi
  • 2,028
  • 2
  • 18
  • 39
16
votes
5 answers

How to generate openAPI code using multiple yaml file

I have two yaml file, customer.yaml and employee.yaml. How do I generate java code from these two yaml file in single project. I'm using gradle, I know the task specification for single yaml but how do I specify multiple yaml. Should I specify…
Nicolas
  • 554
  • 2
  • 11
  • 27
16
votes
4 answers

Does anyone use Swagger Codegen or OpenAPI Generator SDKs in Production?

Swagger Code Generator can generate SDKs in many languages (listed below from the Github project page). Does anyone use any of Swagger's auto-generated SDKs in production, both as alpha/beta and as GA, and if so, what organizations and for what…
Grokify
  • 15,092
  • 6
  • 60
  • 81
15
votes
2 answers

Open API code generator Maven plugin uses old Swagger 2 annotations instead of Swagger 3 annotations

I'm using Open API code generator Maven plugin to generate Open API 3.0 from a file. I'm using this plugin in in my pom.xml: org.openapitools openapi-generator-maven-plugin 4.3.0 The…
Michael Dz
  • 3,655
  • 8
  • 40
  • 74
1
2 3
68 69