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
0
votes
1 answer

typescript export imporatble from tsd

File index.ts (generated with swagger-codegen) export * from './api/api'; export * from './model/models'; File tsd.d.ts ... /// typescript 2.2.1. Why do I still need to use import statements (import myDTO…
terafor
  • 1,620
  • 21
  • 28
0
votes
2 answers

Objective c client generated from swagger-codegen is not working properly when imported mannually in project

I have generated Objective c client from swagger.json. And imported the generated source in my Xcode project by Right clicking on project then choosing Add Files to "ProjectName". As swagger-codegen generated source has dependency on ISO8601,…
0
votes
1 answer

swagger-codegen - How do I supply a body to the generated C# SDK method?

I'm using the (unofficial) swagger-codegen-cli Docker container from https://hub.docker.com/r/jimschubert/swagger-codegen-cli/ which pulls swagger-codegen from the master branch before it runs. I tried grabbing the recently documented (official)…
0
votes
1 answer

How to access swagger yaml defined objects from javascript

I used Swagger Yaml to describe an endpoint and generate the mock server. The existing endpoint (that I'm mocking) doesn't follow RESTful principles 100%, so I simply want to overwrite the response that is returned by the mock server. The simple…
0
votes
1 answer

Spring Swagger Codegen Maven Plugin oAuth2 Client Example

I am bit new to Spring and Java, can someone please an provide example to call an API which takes OAuth access token with ApiClient which is auto-generated using swagger plugin? By providing client id, secret and oAuth Target Url in below sample…
Imran
  • 5,542
  • 3
  • 23
  • 46
0
votes
0 answers

What is meant by this statement w.r.t. swagger framework

"The methods, parameters, and models description are tightly integrated into the server code, thereby maintaining the synchronization in APIs and its documentation." Does it mean that If i make any change in my server code, then I have to make…
0
votes
0 answers

golang enum support in swagger codegen

I am not able to generate the enum with swagger codegen for golang. What modification needs to be done in go model.mustache and GoClientCodegen.java ? I tried this in mustache : {{>partial_header}} package…
Jeet
  • 761
  • 3
  • 10
  • 27
0
votes
1 answer

Spring Boot Deployment Strategy

Am implementing the swagger 2 using Spring Boot. Using Dependencies- io.springfox springfox-swagger2 2.4.0
user5591691
0
votes
1 answer

Module has no exported member

I used Swagger to generate client stub (to call API), this part is fine. When I try to import the class in a component I am getting the error Module has no member of ... import { CollaborationClient } from './../../shared/web-api-client'; Getting…
Sami
  • 3,686
  • 4
  • 17
  • 28
0
votes
1 answer

serialVersionUID in the swagger-codegen-maven-plugin generated code

I'm using swagger-codegen-2.1.6 and successfully generated serialized model classes through swagger-codegen-maven-plugin using serializableModel configOptions. However, I don't see the serialVersionUID added to the classes, neither I can find any…
sahaS
  • 41
  • 1
  • 5
0
votes
2 answers

How to ignore @FeignClient apis from being processed by swagger?

I am using swagger and Feign in one project, and the swagger will take @RequestMapping annotated methods and create the documentation. But this is weird to do so for classes and methods annotated by both @FeightClient and @RequestMapping. So how to…
leo
  • 583
  • 2
  • 7
  • 20
0
votes
1 answer

Infinite query parameters

My application has a possibility to take infinite query parameters like /path?filter={value}&filter={value1}&filter={value2}&....filter={value999} how do I document this on my YAML file and use swagger codegen to create API? I came through…
Anil Pediredla
  • 704
  • 2
  • 8
  • 20
0
votes
3 answers

Implementing Swagger-codegen project - Error:(23, 17) Failed to resolve: junit:junit:4.12

Hi Im new to swagger and It was a while since I developed for Android - haven't understood all with the gradle files etc. Im stuck with this problem with dependency to the JUnit 4.12 I have a project that I wan't to merge with a project created with…
emmanuel2004
  • 117
  • 2
  • 14
0
votes
0 answers

I want to include response and logging of response at server side for swagger server using JAXRS

I am using swagger spec for server side code generation using swagger-codegen and JAXRS. Now I want to get a set of sample inputs as json file for my APIs and respond with those when I hit my APIs by reading the values. Also I want to log these…
Jayant
  • 1
  • 1
-1
votes
0 answers

How to assign null for "object" type property in openapi v3 yaml file

I am generating the code using openapi generator but in generated java files null is not assigned as default value. yaml file : ClassA: type: object properties: classB: $ref: '#/components/schemas/ClassB' generated…
Lokesh Rathor
  • 167
  • 4
  • 12
1 2 3
65
66