Questions tagged [swagger-codegen]

Swagger Code Generator allows the generation of API client libraries, server stubs and documentation by an (Swagger) OpenAPI specification.

Swagger Code Generator allows the generation of API client libraries, server stubs and documentation by an (Swagger) OpenAPI specification.

It can be executed as Maven plugin or directly on the commandline. A wide range of programming languages and various libaries are already supported. Its template engine enables users to add their own generators for other languages or custom implementations.

Use this tag for all questions regarding the generation, its template engine, the usage of the cli.

Useful links

982 questions
-1
votes
1 answer

i'm getting error 500 when i'm trying to perform a function in swagger CodGen

I'm trying to build an API and I'm using swagger editor, swagger gen and swagger UI. I have a YAML file from swagger editor, and I generated a python-flask server, I ran the server and it worked fine, the problem is on my page I have a few endpoints…
-1
votes
2 answers

Swagger document example model customization using annotations

I am working on swagger document, and want to customize the example model in POST request. This request takes a JSON body, which has certain parameters. I want to remove some parameters and and set default values for others. What annotations should…
NTarun
  • 1
  • 1
-1
votes
1 answer

Swagger Codegen Resteasy - catch Deserialization Errors

i generated a server stub for my jax-rs resteasy api and just started using the stub by trying to add Stuff to the MyServiceApiServiceImpl class. I work with swagger-codegen v2.3.1. The generated Code for my Endpoint looks like…
-1
votes
2 answers

Swagger-codegen-js not finding not translating the response schema defined on the api endpoint

Summary I am using swagger-codegen-js to generate typescript files according to the swagger.json defined by an external api. packages used "swagger-js-codegen": "^1.12.0", Alleged Problem The return type on the method listMovies on the generated TS…
Jaya
  • 3,721
  • 4
  • 32
  • 48
-1
votes
1 answer

Swagger autogen - overwriting implementation code

Does anyone here have a good strategy for dealing with a changing API spec? API change -> regenerate code -> implement changes. I'm thinking generating Java interfaces and having separate class files which implement these interfaces. Any interface…
Eamorr
  • 9,872
  • 34
  • 125
  • 209
-1
votes
1 answer

Underscore generated for field called 'return' from swagger json

I have the following problem: A DTO in swagger is defined as "ExampleDto": { "type": "object", "properties": { "exampleProperty": { "type": "string", }, "return": { "type": "number", "format": "double" } …
sergej
  • 193
  • 1
  • 11
-2
votes
1 answer

I want to know can i give name to enum declared in Swagger?

I have an Enum like below enum: - Male - Female but internally i want this as F and M? like if i print Male it should print M not male
1 2 3
65
66