openapi-generator

OpenApi Generator reference an external POJO in YAML file specification

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-17 02:00:03
问题 I'm using OpenApi v3.3.4 (formerly called Swagger CodeGen ) maven plugin to generate my rest controller via api.yml files where I describe all the operations I want to expose. In my use case, I want to expose a method POST: handleNotification(@RequestBody SignatureNotification notification) wich its request body's type is generated via another maven-plugin in /targer folder. Actually I'm defining SignatureNotification in Components part of my .yml file : ... requestBody: required: true

Getting “inject() must be called from an injection context” after upgrading to Angular 11

半世苍凉 提交于 2021-02-10 18:01:25
问题 After upgrading to Angular 11, I am not able to ng serve my web application anymore. I am generating the client using Spring Doc and the latest OpenAPI generator gradle-plutin (5.0.0). The problem appears to be related to my (generated) REST-client. Opening https://localhost:4200 will write the following into the console: main.ts:12 Error: inject() must be called from an injection context at injectInjectorOnly (core.js:4901) [angular] at Module.ɵɵinject (core.js:4911) [angular] at Object

Bug in OpenAPI generator? Wrong format for the example value of date datatype

烈酒焚心 提交于 2021-01-29 21:24:17
问题 I'm using a openapi-generator-maven-plugin with 4.2.3 version. My configuration looks like this: <typeMappings> <typeMapping>OffsetDate=LocalDate</typeMapping> <typeMapping>OffsetDateTime=LocalDateTime</typeMapping> </typeMappings> <importMappings> <importMapping>java.time.OffsetDate=java.time.LocalDate</importMapping> <importMapping>java.time.OffsetDateTime=java.time.LocalDateTime</importMapping> </importMappings> <!-- pass any necessary config options --> <configOptions> <java8>true</java8>

How to Create a Spring-Boot REST Server Using OpenAPITools

社会主义新天地 提交于 2021-01-28 07:53:34
问题 I created a Spring Boot server using the tools at swagger.io, which I'm now porting to OpenAPITools. But I can't find the equivalent generator. I tried setting the generaterName to spring, but it creates a somewhat different application. First, it uses a WebMvcConfigurer Bean, even though it's not an MVC application. Second, the generated Controller and API don't give me an ObjectMapper. Third, instead of an HttpServletRequest, they give me a more ambiguous NativeWebRequest instance. Is there

How to include the client from openapi-generator in a gradle java application?

拜拜、爱过 提交于 2021-01-27 17:39:29
问题 I want to create a gradle java application that generates a client from an openAPI specification file and uses that client. So I created a java application with gradle init (type:application, language:Java, DSL:groovy, test-framework:Junit Jupiter, project-name:simple-java-app, package-structure: a.aa ). Small example of what works: I can create a new source folder second/loc/src/main/java with a package b.bb and a class Foo . And with the following build.gradle plugins { id 'java' id

How to include the client from openapi-generator in a gradle java application?

ⅰ亾dé卋堺 提交于 2021-01-27 17:19:40
问题 I want to create a gradle java application that generates a client from an openAPI specification file and uses that client. So I created a java application with gradle init (type:application, language:Java, DSL:groovy, test-framework:Junit Jupiter, project-name:simple-java-app, package-structure: a.aa ). Small example of what works: I can create a new source folder second/loc/src/main/java with a package b.bb and a class Foo . And with the following build.gradle plugins { id 'java' id

Why discriminator property gets serialized twice?

心已入冬 提交于 2021-01-23 06:14:11
问题 I'm using OpenAPI 3.0 inheritance in components schemas and I have the (Java) classes generated by openapi-generator (which uses Jackson). Why the discriminator property gets serialized twice in the resulting JSON? This is a JHipster API-First project, which should use openapi-generator for generating the Java model (POJOs with Jackson annotations) and API controllers (interfaces with Spring's @Api annotations). By following the OpenAPI 3.x documentation/examples, it seems that the property

How to generate API Documentation using openapi-generator?

大城市里の小女人 提交于 2021-01-18 06:40:46
问题 I'm new to the OpenAPI 3.0.0. I have successfully created a java client library using an openapi-generator . But OpenAPI Generator allows the generation of API client libraries (SDK generation), server stubs, documentation. So I want to know is there any commands or steps are available to generate HTML documentation and also to customize the documentation template. 回答1: Old question, but for those still bumping into it. OpenApi Generator can do generation of html documentation from your yaml

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

人走茶凉 提交于 2021-01-03 16:08:03
问题 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',

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

做~自己de王妃 提交于 2021-01-03 15:59:50
问题 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',