openapi-generator

How to generate, compile, jar, and depend on a gradle module

瘦欲@ 提交于 2021-01-03 15:58:30
问题 I have a Java Gradle project that uses an OpenAPI specified API. I've used the org.openapi.generator plugin which generates sources as well as a complete Gradle module. I expect that there's a way to define the generate, compile, jar steps such that I can have other modules depend on the generated module. I.e. # api/build.gradle: plugins { id 'java' id "org.openapi.generator" version "5.0.0" } repositories { mavenCentral() } dependencies { testImplementation group: 'junit', name: 'junit',

Reference external file (openapi spec) from gradle plugin (openapitools generator)

核能气质少年 提交于 2021-01-01 06:24:52
问题 I am attempting to build an application that references an openapi spec that is already published in artifactory. That means I'll be pulling the foo.yaml in as a dependency, but I can't seem to figure out how to actually reference that file by the openapitools generator plugin. Given that openapi specs can be used to generate both server code and client code, it makes perfect sense that it is published separately and simply pulled in and referenced by implementations. com.company.bar-1.0.10

Why does openapi-generator not create a package.json with typescript-angular?

孤人 提交于 2020-03-20 06:13:08
问题 I am generating code for typescript-angular with the openapi-generator-maven-plugin like this: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <build> <plugins> <plugin> <groupId>org.openapitools</groupId> <artifactId>openapi-generator-maven-plugin</artifactId> <version>4.2.0</version> <executions>

How to use generated Angular client from Spring Boot REST API?

感情迁移 提交于 2020-01-26 03:54:08
问题 I finally managed to generate an Angular client using this tutorial using the openapi-generator-maven-plugin . I had to make a few adaptations e.g. using different dependencies <!-- Spring Docs (Swagger) --> <!-- TODO After version upgrades check https://github.com/springdoc/springdoc-openapi/issues/133 --> <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-core</artifactId> <version>1.1.49</version> <exclusions> <exclusion> <groupId>io.github.classgraph</groupId>

Convert OpenAPI 3.0 to Swagger 2.0

99封情书 提交于 2020-01-24 03:51:26
问题 Is there a generator to convert openapi 3.0 to swagger 2.0? Mashery, an API gateway, requires swagger 2.0 format on input to open endpoint. 回答1: LucyBot api-spec-converter (online version, GitHub repo, Node.js module) can convert from OpenAPI 3.0 to 2.0. API Transformer also claims to be able to convert OpenAPI 3.0 back to OpenAPI 2.0. There's a command-line version too. Keep in mind that OAS3→OAS2 convertion is lossy in general, because OAS3 has features that did not exist in OAS2 (such as

Is there a way to generate a swagger specification file from C++ code?

我与影子孤独终老i 提交于 2020-01-03 08:58:12
问题 I've a requirement to create a HTTP API layer over a legacy API interface written in C++. My plan is to generate the Swagger or open API file and then make it available to bunch of projects that needs to write a client (who will be consumer of new API) or a server (wrapper to legacy API). Is there anything that can expedite this requirement (other than manually parsing them and creating swagger spec file)? i.e. using C++ code to generate swagger JSON/YML file 回答1: Quite late answer and I

Is there a way to generate a swagger specification file from C++ code?

我是研究僧i 提交于 2020-01-03 08:58:11
问题 I've a requirement to create a HTTP API layer over a legacy API interface written in C++. My plan is to generate the Swagger or open API file and then make it available to bunch of projects that needs to write a client (who will be consumer of new API) or a server (wrapper to legacy API). Is there anything that can expedite this requirement (other than manually parsing them and creating swagger spec file)? i.e. using C++ code to generate swagger JSON/YML file 回答1: Quite late answer and I

How to generate an Express + TypeScript API from OpenAPI 3.0 specification?

走远了吗. 提交于 2019-12-24 07:17:11
问题 I wrote specifications for my REST API server using OpenAPI 3.0. Now, instead of manually writing a lot of repetitive code, with all the errors that could be introduced, I'd like to quickly generate an expressjs app. I know I can generate a server app from editor.swagger.io, but the generated code is javascript, so I can't use the typings from my models! Is there a tool that can generate, from an OpenAPI 3.0 specification, an express app written in typescript? It would be awesome if it could

Should I define different POST and PATCH models in OpenAPI?

匆匆过客 提交于 2019-12-11 17:58:29
问题 I am defining a REST API in OpenAPI3 (Swagger). I have an API that has a POST which uses a Model I have defined in teh components section as follows: post: summary: "Used to add some data" operationId: postMyData requestBody: content: application/json: schema: $ref: '#/components/schemas/MyModel' required: true components: schemas: MyModel: type: object properties: SomeProperty1: type: string SomeProperty2: type: string SomeProperty3: $ref: '#/components/schemas/SomeOtherModel' SomeProperty4: