Questions tagged [openapi-generator]
An open-source tool to generate API clients, server stubs, documentation and more given an OpenAPI Spec (v2, v3)
460
questions
1
vote
0answers
11 views
How to disable springfox import on openApi generation?
I would like to replace openapi generator plugin from 5.0.0 to 5.1.0. If I build my project it automatically imports import springfox.documentation.annotations.ApiIgnore; to my all generated by API ...
0
votes
0answers
10 views
use one field to populate another openapi
I would like to populate my one drop down on basis of another drop down.
For e.g. - I have two drop downs 1 - Shape, 2 - Properties
Mapping is like -
Triangle : {
Sides
}
Circle :{
diameter,
radius
}
...
0
votes
1answer
52 views
OpenAPI & Python: How to use apiKey security scheme?
I'm trying to use an API with an OpenAPI specification via Python. I generated the openapi_client and used one of the generated examples to get started. The first call to the API succeeds, but ...
0
votes
0answers
22 views
Nullable enum parameter in C# code generated from OpenAPI v3 yml
The title is too stuffed and rather confusing, so here is a snippet of my yml:
openapi: 3.0.2
...
paths:
/whatever:
get:
tags:
- hi
parameters:
- name: status
in: ...
0
votes
1answer
48 views
Is it possible to use @Parameter in a REST controller?
I'm trying to use @Parameter for a path parameter in a @RestController, but it ignores the parameter.
Note: All works well if I use @PathVariable instead (commented). However, @PathVariable does not ...
0
votes
0answers
12 views
openapi-generator-cli for java to cover unknown properties that are not covered in the openapi definition
I am using openapi-generator-cli.jar to generate just java model classes (the calling client I am not generating) from a openapi definition yaml file.
But the real requests have additional properties ...
0
votes
0answers
13 views
Openapi 3.0: Payload dosen't reflect my schema allOf
I have a little trouble: whithin yaml i will create a generic schema whit some filed. Then i would reference it in various PUT\POST call.
in every put\post i will create a specialization of this ...
0
votes
0answers
7 views
Compilation error with openapi-generator's 'cpp-restbed-server' generator for list constructs
Generated the cpp code for an openAPI spec via:
./run-in-docker.sh generate -i <open-api-yaml-file> -g cpp-restsdk -o <output-directory>
There is an issue with generated constructs having ...
0
votes
1answer
16 views
How to disable OpenAPI2SpringBoot class generation in openApiGenerate
Following is my build.gradle configuration
plugins {
id 'java'
id 'maven-publish'
id 'org.springframework.boot' version '2.3.9.RELEASE'
id 'io.spring.dependency-management' version '1....
0
votes
1answer
19 views
openApiGenerate plugin in gradle project not generating source code
Following is my build.gradle configuration:
plugins {
id 'java'
id 'maven-publish'
id 'org.springframework.boot' version '2.3.9.RELEASE'
id 'io.spring.dependency-management' version '1....
0
votes
0answers
7 views
How to test OAS generated Client SDK
How to test typescript-fetch Client sdk generated by OpenApi-generator in locally
0
votes
0answers
52 views
Does OAS3 callbacks also relate about the Service implementation part, if at all this callback endpoint might be a part of different Swagger as well?
Lets say I have OAS3 based Swagger101.json that has a subscription endpoint operation which is configured with a callbacks operation for callbacks URL.
So apart from invocation of callback, does the ...
0
votes
1answer
23 views
Why does openapi-generator create InlineObjects?
I'm using
https://github.com/OpenAPITools/openapi-generator
to create a client for my API. It's mostly working ok, but the generator creates a lot of InlineObject types that encapsulate parameters ...
0
votes
0answers
21 views
Unable to generate jar with lombok support using OpenAPI generator
I have been trying to add lombok support, for the entities generated in the jar via the open API
generator tool.
i have noticed an open issue on openapi-generator git hub page about the same.
however, ...
0
votes
0answers
15 views
How to define login API written in OpenAPI to return cookie from the response to its generated code
I want to write an API for a login request.
If the login request is successful then the API should return the cookie from the response header. Otherwise returns the response error message.
the request ...
3
votes
0answers
23 views
Swagger ignored the required field for generated code
I have element like this:
@ApiModel(description = "...")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class MissionContext {
@...
0
votes
0answers
36 views
OpenApi generator doesn't allow multiple schema in content
I've an OpenAPI contract like this:
openapi: 3.0.1
info:
title: Internal API
version: ''
tags:
- name: Calendar
description: Api for Calendar resource
paths:
'/api/v1/appointments/{id}':
...
0
votes
0answers
8 views
How to reuse and append specific text template
as shown below in the code, i would like to reuse the text/*
Bad request.Assert that the values provided adhere to the following order and comma separated':'originLng, originLat, destinationLng, ...
-1
votes
0answers
22 views
how to add array of examples in the component object
i am trying to add an array of examples as shown below in the code.
there is something wrong in the code below so i get the following error:
openapi: '3.0.2'
Swagger schema validation failed.
Object ...
0
votes
0answers
16 views
how to create responsr objects for methods return json and string
As shown below, i have two web services with the following routes
@app.route("/", methods=['GET','POST'] )
@app.route("/getDistanceFromOriginToDestination/<string:...
0
votes
0answers
20 views
how to build paths and responses object for a url
i would like to create the path object for the following url
url: "http://127.0.0.1:5000"
in the code when the user enters the above mentioned url followed by slash \ a method called start()...
0
votes
0answers
19 views
not found symbol error when trying to generate code using open api
I'm trying to use open api 3 with spring boot 2. It generates ApiUtil class. I'm using use JAVA 11.
but it could not find this class when building the project.
[ERROR] /Users/bilelfrikha/Documents/...
0
votes
0answers
21 views
OpenAPI generator jaxrs-spec stop shorterning my enum values
Given this OpenAPI specification for the sizeRange field of a Project model:
size:
type: string
description: Size range for this project
enum: [RANGE_0_10M,RANGE_10M_50M,RANGE_50M_100M]
...
0
votes
0answers
25 views
Versioning APIs during internal development
In our team we have a number of APIs specified using the Open API Specification (formerly Swagger). We use Maven and OpenAPI Generator to generate code, build and publish the artifact to our local ...
0
votes
0answers
28 views
SpringDoc generate OpenApi spec with multiple media types
In my Spring project I'm using Springdoc to generate a OpenApiSpecification doc.
I created my Api with these annotations. I want to have the same endpoint url with different mediatype to handle the ...
1
vote
0answers
10 views
Unable to pass custom header in swagger Oauth
In case of Oauth2 security type in swagger, there is one custom generated value(CSRF Token) that needs to be passed in order to execute the service for our flow to execute.
But we are not able to pass ...
1
vote
0answers
15 views
How can I transfer array type from swagger.json into List[int] in python rather than list[int]?
There is a parameter's type is array in swagger json. When I convert it into python apilib, the type transfer into list[int].
I use it to define method like this:
def ...
0
votes
0answers
22 views
How to declare a 'List<MyOwnType>' in an OpenAPI/Swagger-file?
How declare a 'List' in an OpenAPI/Swagger-file?
The below code has generated List<String>
myTestProperty:
type: array
items:
type: string
But not sure how to generate List<...
2
votes
1answer
27 views
What is the correct way to declare a 'char' in an OpenAPI/Swagger-file?
What is the correct way to declare a 'char' in an OpenAPI/Swagger-file? I tried these.. but didn't work
myTestProperty:
type: char
example: C or B
I tired this way as well, but no luck
...
1
vote
0answers
88 views
Complex return types with Spring WebFlux returning response status, headers, and body, asynchronously at a later point [closed]
Background
Using API-First design with Spring Boot and project Reactor's WebFlux. Thankfully the Open API Generator Project (version 5.0.1 for Gradle as of writing) will generate a WebFlux reactive ...
0
votes
1answer
34 views
OpenApi Generator: Use Long as Numeric default?
We are using openapi-generator's openapi-generator-maven-plugin to automate an integration with a swagger which uses Numeric datatypes that are not int64. Our codebase tries to standardize around ...
1
vote
0answers
24 views
How to initialize multiple times the same Component with different dependencies?
I am currently have a spring service consuming an REST service via autogenerated code.
I placed an internal interface to have an abstraction from the REST interface since it is still in development.
...
0
votes
1answer
39 views
Can't get form params from an OpenAPI 2.0 generated Python-Flask application
I'm trying to process a simple HTML form from a Python application described using OpenAPI 2.0 and generating the Flask-Connexion code using OpenAPI Generator v4.3.1 and v5.0.1, but I always get a ...
0
votes
1answer
30 views
Disable setting User-Agent in javascript code generated by openapi-generator-cli
In the context of a Vue.js frontend, it seems that the javascript client code generated by openapi-generator-cli is trying to set the User-Agent which gives the following error in Google Chrome:
...
1
vote
0answers
29 views
Issue with python client and open api spec with discriminator object
I have the following basic open API spec. It is mostly based on the example of hierarchy via descriminators showed in the open API specs documentation.
openapi: 3.0.0
info:
title: Test Inheritance
...
1
vote
0answers
46 views
OpenAPI Generator Maven Plugin Bean Validation MinProperties Validation
I have a Spring Boot (2.4.0) REST service, using Java 11. The endpoints and objects are generated from an OpenAPI 3.0.3 file using openapi-generator-maven-plugin v5.0.1
In the API there is a GET ...
0
votes
0answers
48 views
Could not compute datatypeWithEnum from MultipartFile, null
I'm new to Gradle and trying to generate dart code from openapi-generator.
task generateCode(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
generatorName = "dart2-api&...
1
vote
2answers
66 views
Failed to Compile using OpenAPI TS Module with React - “You may need an additional loader to handle the result of these loaders”
I have a create-react-app application in web which I want to locally import a module that is outside of src. However, there seems to be some issue with loaders and Webpack. I have no idea why this is ...
3
votes
1answer
125 views
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 ...
0
votes
0answers
57 views
Springdoc-openapi-ui OpenAPI Java Generator Inheritance
Since springdoc-openapi-ui version 1.4.0, I am not able to manage java pojo inheritance anymore.
I know that the concept of AllOf, OneOf has been added in 1.4.0 but I can't figure out how to make it ...
0
votes
0answers
36 views
Swagger/openapi generator - map namespaces to directory structure
In my .net core web api project I use swagger to generate the json description file. After that I use openapi generator to generate services/models in typescript for angular.
In my web api I use dtos ...
0
votes
0answers
30 views
Multiple Gradle Files in the same project using apply from
I'm trying to segregate the gradle tasks to respective gradle files.
build.gradle
plugins {
id 'org.openapi.generator' version '4.3.1'
}
apply from: "$projectDir/gradle/script/openapi.gradle&...
0
votes
0answers
23 views
Override class naming rules for OpenAPI Code Generator
I'm trying to generate code from an OpenAPI specification that I got from another service provider. The specification uses schema name convention that results in very lengthy class names when ...
0
votes
0answers
39 views
Openapi-generator-maven-plugin authentication query params not sent
I have an issue with query authentication params after upgrading the openapi-generator-maven-plugin from 4.3.0 to 5.0.1. I have a apiKey query param that used to be send in the url. After updating to ...
0
votes
0answers
15 views
Use original enum in Open API maven plugin
I'm generating some models using the plugin:
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>5.0.0-beta2</version&...
0
votes
1answer
49 views
Globalize tags for certain controller names in OpenAPI
i am having issues with OpenAPI , so here i am asking for help.
My problem is that i am having a .yml file where my routes are imported and it looks like this
as you can see the persons such as ...
3
votes
0answers
78 views
Does response status code make sense for multiple media types for error status codes as per OpenAPI 3 (Swagger) spec
If we follow the OAS3 spec for Response here we can see that each response status code can have multiple media types and each media type in turn has a schema particular to it.
UseCase : For example ...
0
votes
0answers
32 views
Generate an OpenAPI NestJs server stub
I'm messing around with custom templates for the OpenAPI-Generator CLI to make a server stub for NestJs (controllers, services, mongoose model templates) and I can't seem to strip off the *Service for ...
0
votes
1answer
67 views
How to use the Open API 3 gradle plugin
I'm trying to use the Open API 3 generator plugin for gradle.
It is enough to add the lines
plugins {
id "org.openapi.generator" version "5.0.1"
}
in the project's build....
0
votes
0answers
40 views
How to generate an enum of type number with open-api
I have an enum:
export enum myEnum {
test = 'hey',
test2 = 'how',
test3 = 'are',
}
When i generate this enum with openapi-generator generate -i url, my json will be like that:
"...