Open turkeylurkey opened 4 years ago
@turkeylurkey please can you confirm, this is the generator you're referring to? https://github.com/OpenAPITools/openapi-generator
Yes, that's the one.
+1 from me. I just created an issue: https://github.com/OpenAPITools/openapi-generator/issues/6189
I haven't gotten the <library>
tag to work, but it should be easy creating a new folder in https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator/src/main/resources/JavaJaxRS/
If OpenLiberty could contribute such a generator to openapi-generator, that would be awesome and super helpful! I do not see another way to consume an OpenAPI document in Liberty.
use jaxrs-spec
and overwrite some of the templates yourself. It is a bit of work, but will do.
The swagger annotations are quite a bit different, I wasn't able to come up with something useful and did not implement then.
If you do not need annotations, it is just a simple change in the pojo.mustache
class: Just replace two or three imports and change JsonProperty
to JsonbProperty
etc. (two occurrences).
That's it, if you only need to generate interfaces!
Is your feature request related to a problem? Please describe. When a developer needs to implement a REST service which is already described by an OpenAPI v3.0 or Swagger v2 document, it takes a long time to write the Java code. This is a mechanical process, at least at the start, and should be automated.
Describe the solution you'd like The OpenAPI Generator can generate client and server stubs when given an OpenAPI v3.0 (or Swagger v2) document that describes a REST interface. To work with OpenLiberty we should use the Java or the JAX-RS generator and it should use JSON-B for the data. It should also generate MicroProfile annotations in the Java code to help the developers who use that specification.