Questions tagged [openapi-generator]
An open-source tool to generate API clients, server stubs, documentation and more given an OpenAPI Spec (v2, v3)
703
questions
0
votes
0
answers
18
views
OpenAPI generator add annotation on field level
I am using openapi generator (5.4.0) with gradle(7.3.3) and SpringBoot (2.6.6).
my OpenApi configuration:
ext.openApiConfigOptions = [
library : "spring-boot&...
0
votes
0
answers
17
views
OpenAPI: Best approach for scaling a strongly-typed API suite
I have the same object that needs to be used across multiple SDKs.
Say the yaml file for ServiceA contains Object1 and I want to use it in the ServiceB yaml file.
In the ServiceB file I easily ...
1
vote
0
answers
22
views
oapi-codegen gin server append error with c.Error() instead of dumping it with c.JSON()
This is the command I'm using to generate the gin server:
oapi-codegen -generate gin,types,spec -package api api/openapi/api.yaml > internal/api/openapi/api.go
When the gin server code is ...
1
vote
0
answers
26
views
OpenAPI generator:configure lombok with Builder/Builder.Default
I am using openapi generator (5.4.0) with gradle.
It is configured with spring generator name, and added lombok configOptions.
additionalModelTypeAnnotations : "@lombok.Builder; @lombok....
0
votes
0
answers
25
views
How to correctly use different types for the same property in OpenAPI 3.0 Swagger?
I am trying to create a class with 3 properties:
description: Change operation data
type: object
properties:
op:
description: Handy shortcut for operation name
type: string
...
0
votes
0
answers
26
views
OpenAPI 3 path substitution with openapi-generator-maven-plugin
I would like to generate a java interface with Spring annotations for an OpenAPI 3.0.1 specification in yaml. In particular it is the @PutMapping I want to ask about.
I would like as outcome something ...
0
votes
0
answers
38
views
How to use OneOf with OpenAPI generator for Dart?
I'm trying to use the OpenAPI generator for Dart (in particular dart-dio-next). First, some code and tooling invocation snippets:
API specification: https://raw.githubusercontent.com/aptos-labs/aptos-...
0
votes
1
answer
12
views
Defining the server to use in openapi-generator.tech Go client
Working on a new SDK generated from openapi-generator.tech, using the Go client templates.
I have the following being generated for my configuration:
func NewConfiguration() *Configuration {
cfg := &...
0
votes
1
answer
39
views
I'm testing with go openAPI
I'm testing with OpenApi and as an example with https://github.com/d-vignesh/Todo-App-with-OpenAPI but if i run this, i get the following error:
.\main.go:9:77: undefined: GetTodosParams
.\main.go:31:...
-1
votes
0
answers
13
views
Is there a tool to manage in house extensions to third party OpenAPI specifications?
I'm using a SaaS platform and have used their OpenAPI spec to generate a Python client to interact with the services programmatically. They have some gaps in their specification vs what they actually ...
0
votes
0
answers
14
views
How do I pass SSL Context into a Python Client that Uses the Autogenerated OpenAPI Python Client Library
I have a Python3 OpenAPI client application that gives me the following error: "unable to get local issuer certificate".
This application uses the autogenerated python client libraries ...
0
votes
0
answers
24
views
Spring HATEOAS with OpenAPI Generator
I have an OpenAPI specification and generating code for my spring boot application. The RequestMapping contains a variable with a default value after generating the code.
@Generated(value = "org....
0
votes
0
answers
30
views
openapi-generator: void instead of Void for JavaSpring templates?
Can you help, please with my question: at now is it possible to check the type for "isVoid" in Java templates? I generate Spring controllers with standard openapi-generator JavaSpring ...
0
votes
0
answers
29
views
Openapi Generator won't generate a readme.md file, but only for typescript-axios and typescript-fetch generators
I tried to generate a client like this:
openapi-generator generate -i path/to/api_spec/_build/api_name.yaml -g typescript-axios -o path/to/api_name_typescript_axios_client --package-name=...
1
vote
0
answers
45
views
openapi - Return a file upon simple get request
I am trying to create a rest api, that, given a get request, returns a file. The contents of the file can be a text based format, like xml or json but it can also be binary. For this reason I just ...
0
votes
0
answers
35
views
Angular Universal - TypeError: Converting circular structure to JSON
I am having a big problem related to Angular Server-Side Rendering (SSR), the usage of Resolvers and HTTP requests.
I am building a project in Angular 13, but I decided to implement SSR in order to ...
3
votes
0
answers
83
views
useAbstractionForFiles OpenAPI WebClient not working
I am using OpenAPI generator (Gradle plugin version 5.4.0) to generate a few API calls. One of said calls, revolves a file download from an external service i.e my application calls that one and ...
0
votes
0
answers
48
views
Is there a way to generate the OpenAPI/Swagger definition from Postgres with object references?
I have a rest api using supabase/postgres(t) which generates it's own OpenAPI/Swagger definition. The problem is that this only contains the id fields but not actual references to the other tables.
...
0
votes
0
answers
53
views
OpenAPI Generator gradle plugin task not executed
In my android project I am trying to include the openapi-generator plugin to generate a client. I've copied the instructions from the readme for my project. Unfortunately, the task doesen't seem to be ...
0
votes
0
answers
14
views
openapi-generator-maven-plugin giving error PKIX path building failed [duplicate]
I am getting below error when I call a API using auto generated client for openapi-generator-maven-plugin.
javax.net.ssl.SSLHandshakeException: PKIX path building failed:
sun.security.provider....
0
votes
0
answers
43
views
Oauth2 token request missing Basic credentials with openapi-generator generated java code
I'm trying to use generated (java) code with openapi-generator to access oauth2 securized api endpoints.
Generated code is done with open-api-generator-maven-plugin with pom :
<build>
<...
0
votes
0
answers
61
views
Open Api Generator Cli
My swagger yaml for an endpoint request object looks like
auth.LoginGoogleRequest:
properties:
id_token:
type: string
required:
- id_token
type: object
which means hit the endpoint with body ...
0
votes
0
answers
17
views
open-api generator not coonverting ~1 into slashes
I have an issue with open-api generator
We have a yaml that contains $ref:'#/paths/~1name/
But the ~1 is not escaped.
Is there a configuration i am missing?
I have tried io.swagger.codegen.v3 and open-...
0
votes
2
answers
53
views
OpenAPI Python Generator - convert from dict to model
Using openapi generator for python, I get a bunch of generated models, which I can instantiate like so:
> yoda = Jedi(name="Yoda", light_saber=LightSaber(colour="green"))
I can ...
0
votes
0
answers
30
views
Pass generated sources to go_library
I have a set of openapi-generator-bazel generated go sources. Is there a way to pass them to a go_library rule?
0
votes
0
answers
21
views
openapi generator Select Server Configuration
I'm using openapi 3.0 and openapi generator 5.4.0 to generate code for go. I have multiple servers configured. There is a "Select Server Configuration" part in README. It supplies example, ...
0
votes
0
answers
53
views
Spring boot call external API with external YAML API definition
I am trying to find way, how to call external API based on YAML definition:
I have (Spring boot, external) API-1, generated with OpenAPI plugin, which has
it's YAML file.
I have (Spring boot) API-2, ...
0
votes
0
answers
18
views
Modify a Gradle plugin classpath
I've written a new generator for openapi:
https://openapi-generator.tech/docs/customization
and I've published it to my local maven repository. I'm running into a problem incorporating my custom ...
0
votes
0
answers
22
views
Is there a way to only output oneof fields in response body for a proto definition
For context, I am investigating why oneof returns null fields for fields that were never set. Below is my proto definition, and response body. I use proto buf definitions as a way to pass messages ...
0
votes
1
answer
21
views
openapi generates minimum and maximum which is not working properly
openapi minimum/maximum
put:
summary: add
operationId: add
requestBody:
description: value
required: true
content:
application/json:
...
0
votes
1
answer
48
views
Erroneous element error with mapstruct and OpenAPI
While trying to convert the java model generated by openapi-generator with MapStruct getting the following exception
error: No implementation was created for EmployeeMapper due to having
a problem in ...
0
votes
0
answers
23
views
Maven openapi generator plugin generates Auth classes
I'm building a very simple API with maven plugin configuration here. But it generates some Authentication classes (auth package and some other classes like StringUtil, JSON) I've never defined in my ...
0
votes
0
answers
84
views
How can I set a custom value for the @JsonProperty annotation, when generating a client using the kotlin-spring OpenApi generator?
I'm generating an API client from Open API specs (3.0.0), using openapi-generator:5.4.0 and kotlin-spring generator.
The generated data classes for the models have the @JsonProperty annotation. The ...
0
votes
0
answers
37
views
OpenAPI - Generate only one object definition shared in two similar API yml files
Actually, I'm working on generate Java project entities sctructure for two different API yml files refering to version 0 and version 1.
Both files contain the same enum but at the moment to generate ...
0
votes
0
answers
18
views
Using doctrine, apiplatform and openapi generator leads to duplcate id field in the frontend side, how to solve this?
I m using Symfony 4 with Doctrine and API Platform to build the backend of my application.
I generated entities using php bin/console make:entity. Each class has an id field like this one
/**
* @...
1
vote
1
answer
105
views
OpenAPI spec says "application/x-ww-form-urlencoded" but generated spring boot expects multipart/form-data or multipart/mixed stream
I am trying to use an OpenAPI spec from an existing Python demo to create a similar demo in Java, and have used the "spring" generator with openapi-generator-maven-plugin and the following ...
0
votes
0
answers
51
views
I can't get the tutorial code running ("Cannot load configuration class", Java Spring Boot OpenAPI generator)
I tried out this tutorial to get my first tryout for OpenAPI contract-first development.
I got the following error:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0....
0
votes
0
answers
7
views
how to implement infinite scrolling with custom hook that generated by Orval
here is apcApi.schemas that generated by orval:
* Generated by orval v5.5.3 🍺
* Do not edit manually.
* OpenAPI spec version: 1
*/
export type GetTransactionsParams = { limit?: string; skip?: ...
0
votes
1
answer
108
views
Dockerfile OpenApi Generator
I am trying to avoid importing all kinds of dependencies in my docker images (by way of npm or java) so that I can generate a swagger client.
I am using openapitools/openapi-generator-cli but when I ...
0
votes
1
answer
38
views
OpenAPI Generator vs. CDC Testing with Pact
We're overhauling our frontend and backend service contract reliability and are investigating two tools/techniques that seem to conflict. Consumer and provider code generation from an OpenAPI Spec (...
2
votes
2
answers
220
views
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:
...
0
votes
0
answers
42
views
openapi-generator-maven-plugin 5.3.0 wrong basePath on generate typescript service .ts
I have a SpringBoot 2.2.6 WebApp, I use:
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.5.12</...
0
votes
1
answer
82
views
Does urllib3 support HTTP/2 Requests? Will it?
I know the following about various python HTTP libraries:
Requests does not support HTTP/2 requests.
Hyper does support HTTP/2 requests, but is archived as of early 2021 and wouldn't be a good choice ...
1
vote
1
answer
22
views
How to generate AsyncResponse-style methods using OpenAPI Generator for jaxrs-spec?
I need to generate server-side service interfaces that perform asynchronous processing using the jaxrs-spec generator. I see that the generator supports JAX-RS 2.1 CompletionStage-style asynchronous ...
0
votes
1
answer
44
views
@openapi is not working/recognized in typescript project
I have defined the swagger.ts as below:
import swaggerJSDoc from "swagger-jsdoc";
import { version } from '../package.json';
const options: swaggerJSDoc.Options = {
definition: {
...
0
votes
0
answers
57
views
OpenAPI Generator - How to retry request in InterceptResponse after refreshing JWT token?
I am using OpenAPI Generator in a C# project to generate a client which I can then use to interact with a Thingsboard instance and I just came across the exact same problem which someone else already ...
0
votes
0
answers
62
views
Why does OpenApi generator name the class of service Api as "DefaultService" in Angular13
I add OpenApi Generator in my angular project, but when i generate the Api with the command " openapi-generator-cli generate -i ../openApi/src/main/resources/api.yml -g typescript-angular -o src/...
1
vote
0
answers
66
views
How to add Location Header in response body on go-restful plugin
I cannot add documentation on response header and generate this schema by using go-restful :
I want response body on schema to be like this:
"responses": {
"302": {
"...
0
votes
1
answer
95
views
SwaggerUI is defaulting to version 2 when a Springboot project is generated using openapi generator cli jar
I am trying to generate a spring boot project using the below yaml file with openapi generator cli jar
openapi: 3.0.0
info:
title: Dealer Management System
description: REST APIs to manage dealers
...
0
votes
0
answers
13
views
Gradle openapigenerator not using templates from templateDir
I am trying to use custom templates with the openapigenerator-plugin (v5.4.0), but it seems like the templates are not used
build.gradle.kts
val generateApi = tasks.register<GenerateTask>("...