Questions tagged [openapi-generator-cli]
70 questions
7
votes
1 answer
How to define alias in OpenApi, eventually using it in Pojo
Let's assume I have this definition in my openapi.yml (this is just a madeup example to depict the issue I have):
components:
schemas:
Address:
type: object
properties:
name:
type: string
zip:
…

Marged
- 10,577
- 10
- 57
- 99
4
votes
1 answer
error: The spec file is not found, Check the path of the OpenAPI spec and try again
I have a problem with generating client API using openapi generator on Docker.
After runing:
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate -i ./petstore.yml -g typescript-angular -o api/petstore
I got an:
[error]…

Yura Demkiv
- 346
- 2
- 8
3
votes
1 answer
Open API Generator using aspnetcore 6.x nested classes names
The Problem
With version 6.x of Open API Generator using ASP.NET Core, nested object types are being created as their own classes for reasons unknown. 5.x versions of the openapi-generator used the same class for nested objects.
With these two…

Marc Stevenson
- 1,090
- 8
- 9
3
votes
1 answer
OpenAPI java generate-sources client... How to add "new header" not mentioned in yml before firing http request
OpenAPI client generation module generates client-code(ApiClient-RestTemplate and APISpecificClient which uses ApiClient)
The contract is always strict. Ex: I have to specify in:header in:path in:query for the etc... for API request and…
3
votes
1 answer
Error: /bin/sh: java: not found with @openapitools
I'm trying to run an Angular app container with this docker file:
# stage 1
FROM node:alpine AS my-app-build
WORKDIR /app
COPY . .
RUN npm install @openapitools/openapi-generator-cli -g
RUN npm run build
# stage 2
FROM nginx:alpine
COPY…

Otourou Da Costa
- 142
- 2
- 9
3
votes
0 answers
Logging http request without authorization/token header express-winston on openapi-generator-cli server stub
I am trying to use express-winston to log on my nodejs-express-server app.
This app is an openapi API server stub created from openapi-generator-cli.
Was referring to this post about excluding params while logging the request.
My intention here is…

Naveen Karnam
- 433
- 2
- 9
- 26
2
votes
0 answers
OpenAPI-Generator (Go Server): Create endpoint which allows file download
I'm using OpenAPI-Generator for Go server: https://github.com/OpenAPITools/openapi-generator,
and I'm trying to generate an endpoint which allows file download (excel file to be precise).
I checked OpenAPI documentation and based on it I made this…

Alen
- 1,750
- 7
- 31
- 62
2
votes
0 answers
Generate Typescript ES6 Map with OpenAPI Generator
I'm using the OpenAPI Generator (typescript-angular, but I'm also having the same issue with all other typescript generators) to generate models from a OpenAPI specification that includes:
name:
type: object
additionalProperties:
type:…

Hickory
- 57
- 5
2
votes
1 answer
OpenAPI generator: select or skip APIs by tags
I have a big OpenAPI file with lots of methods tagged with a list of APIs, for example:
tags:
- name: Marketplace API
description: APIs used in order to use Marketplace Payment Flow
- name: Payment API
description: Payment API V4. If…

Alex Babak
- 21
- 5
2
votes
0 answers
Spring Boot 3 Upgrade - Jakarta EE - hibernate-jpamodelgen-jakarta and openapi-generator-cli-6.3.0 are not working as expected together
While upgrading the application to Spring boot 3 from Spring boot 2.7.7, I am facing a problem. I am not able to generate JPA static models using hibernate-jpamodelgen:6.1.7.Final" when also using openapi-generator-cli-6.3.0 to generate code for…

jeet427
- 538
- 3
- 16
2
votes
1 answer
How to use a custom go http client with the client side go code generated from openapi spec
I am working on generating an http client library from an API specification which is in open api format.
The command I am using to generate this is similar to this
openapi-generator generate -g go -i spec.yaml -o code-gen-go -p…

wedneday
- 23
- 3
2
votes
0 answers
How to force OpenAPI Generator CLI to use pre-downloaded .jar file?
I have installed (via npm) openapi-generator-cli on my WSL running Ubuntu 22.04 image, with correctly configured HTTP_PROXY and HTTPS_PROXY environment variables.
The problem is, running any command (including sudo openapi-generator-cli help)…

Dragomok
- 604
- 3
- 11
- 29
2
votes
0 answers
OpenAPI Generator: How to ignore missing properties in openapi yaml file
I am trying to generate an API client for Nestjs using this openapi definition. However openapi-generator-cli report lots of missing content fields, here are a few examples:
[[nestjs-generator] ./hapi-fhir-openapi.yaml] -attribute…

dude
- 79
- 6
2
votes
0 answers
React Client post request uploading image?
I am trying to upload an image from my react client to a backend api server, which has an endpoint parameters defined as:
file: string($base64)
(formdata)
open api file example shows : Example : U3dhZ2dlciByb2Nrcw==
I'm using OpenApi TypeScript…

dev
- 255
- 1
- 3
- 15
2
votes
1 answer
OpenAPI 3.1 with openapi-generator-cli typescript-fetch: JsonParseException: Unrecognized token 'openapi': was expecting (JSON String, ...)
I would like to generate a typescript-fetch client using openapi-generator-cli. The specs were generated by Stoplight using OpenAPI 3.1 format. However when I run the command
openapi-generator-cli generate -i resources/openapi/Attribute.yaml -o…

savage-sarah
- 23
- 5