swagger-codegen

Configuring OAuth2 access token to typescript-angular2 client

拟墨画扇 提交于 2019-12-10 11:05:27
问题 I do not fully understand how to provide OAuth2 access token from a promise (oidc-client-js) to API code generated with Swagger-CodeGen. It is easy to provide constant values, but how do I change below to get the user's access token from oidc-client-js? I would like to know the "correct" way. It would be easy enough to stick this token somewhere in a global variable. @NgModule({ imports: [ CommonModule, ApiModule.forConfig(() => new Configuration({ accessToken: 'my-access-token' //this can

How to run swagger-codegen for OpenAPI 3.0.0

牧云@^-^@ 提交于 2019-12-09 03:00:59
问题 looks like official swagger for openapi specification V3 support is near release https://blog.readme.io/an-example-filled-guide-to-swagger-3-2/, and the swagger-codegen has 3.0.0 support developed and passing some level of testing https://github.com/swagger-api/swagger-codegen on the 3.0.0 branch I have a swagger spec (generated from my existing 2.0 spec via https://github.com/mermade/swagger2openapi, output looks good) Is there an easy way to run the swagger-codegen without having to package

How to generate spring cloud feign client using swagger-codegen-maven-plugin

可紊 提交于 2019-12-07 20:23:47
问题 I want to generate my feign client code using swagger-codegen, but I cannot find the docs which can lead me to do it. I have a microservice using spring cloud, several api-services using spring-cloud-feign interfaces to request the data.I wish that i can generate the feign client code. <plugin> <groupId>io.swagger</groupId> <artifactId>swagger-codegen-maven-plugin</artifactId> <version>2.2.3</version> <executions> <execution> <goals> <goal>generate</goal> </goals> <configuration> <inputSpec

Reactjs client for Swagger / OpenAPI API specification

强颜欢笑 提交于 2019-12-07 05:30:33
问题 Background Using Swagger Editor, I created a spec for my API. I see that Swagger also provide a "Generate a client" option in their Swagger Editor (probably using Swagger Codegen). Objective I want to generate a client and use it in my React app (created with create-react-app), and preferably enjoy some static typing capabilities (currently using flow). Currently None of the options in Swagger Editor there seem to work: javascript - provides a vanilla node module that you need to npm install

How to generate spring cloud feign client using swagger-codegen-maven-plugin

 ̄綄美尐妖づ 提交于 2019-12-06 11:25:38
I want to generate my feign client code using swagger-codegen, but I cannot find the docs which can lead me to do it. I have a microservice using spring cloud, several api-services using spring-cloud-feign interfaces to request the data.I wish that i can generate the feign client code. <plugin> <groupId>io.swagger</groupId> <artifactId>swagger-codegen-maven-plugin</artifactId> <version>2.2.3</version> <executions> <execution> <goals> <goal>generate</goal> </goals> <configuration> <inputSpec>http://localhost:9141/v2/api-docs?group=building-service-api</inputSpec> <language>java</language>

Configuring OAuth2 access token to typescript-angular2 client

删除回忆录丶 提交于 2019-12-06 05:38:30
I do not fully understand how to provide OAuth2 access token from a promise (oidc-client-js) to API code generated with Swagger-CodeGen. It is easy to provide constant values, but how do I change below to get the user's access token from oidc-client-js? I would like to know the "correct" way. It would be easy enough to stick this token somewhere in a global variable. @NgModule({ imports: [ CommonModule, ApiModule.forConfig(() => new Configuration({ accessToken: 'my-access-token' //this can also be a () => string function })) ], In normal components with OnInit, I can get the token in a promise

swagger-codegen client: How to include jackson annotations on models

北战南征 提交于 2019-12-05 22:39:11
I'm using swagger-codegen to generate a rest client, but I get a problem, the service I'm consuming returns a model with an inheritance, the API model looks like this: public class Person { private List<Book> books; ... } @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "typeClass") @JsonSubTypes({ @JsonSubTypes.Type(value = Magazine.class) }) public class Book { //some prop } @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "typeClass") public class Magazine extends Book { //some prop } The API model is annotated

How to open Swagger-ui from vert.x

走远了吗. 提交于 2019-12-05 22:12:05
问题 I want to implement Swagger-UI in Vert.X app. I have listed all routes and I want to see them in swagger-ui like in SpringBoot. I have also manually edited them in swagger-editor. So, how to open localhost:8080/swagger-ui.html from vert.x app and there to see all routers. I read that i need to save the json from swagger-editor and to put it in src/resources. After that what? Also i found a great stuff here: https://github.com/phiz71/vertx-swagger and http://vertx.io/blog/presentation-of-the

How to bundle Swagger generated code with webpack

☆樱花仙子☆ 提交于 2019-12-05 21:43:42
I'm creating a new webApp that needs to communicate with the server using a REST API. I want to use Swagger to define the REST API and to generate the code for the server and the Javascript client (a simple webapp running in a browser). I was able to implement the server (using a Java servlet) and it works. I have generated the code for the Javascript client but I'm not able to make it works (I'm a very beginner in Javascript, webpack, nom...). I want to use webpack to generate a .js file that will be loaded by the webapp, this .js will contain the code generated by swagger and my code to send

How to use Swagger Codegen with .net core

天大地大妈咪最大 提交于 2019-12-04 23:20:36
问题 I am able to integrate the Swagge UI in my web api using Swashbuckle. I also want to explore the swagger codegen feature. Can somebody help in - how I can integrate swagger codegen into my web api project? Or do I need to download any tool? I want to be able it to host the codegen and pass the json/raml form specs to generate client in .net core. I am not able to find enough docs on above. EDIT : I want to know how I can host codegen in my WEBAPI. Thanks! 回答1: You should install " Swashbuckle