openapi-generator/samples/server/petstore/jaxrs-spec-required-and-readonly-property
Flemming Nørnberg Larsen a4508f6817
#18058 Fix the Java generator to generate valid @RequestMappings where the produce field takes list of string parameters instead of a single comma-separated string (#18092)
* #18058 Fix AbstractJavaCodegen.getAccepts() so it returns a String array instead of a comma-separated string, and fixed api.mustache so the @RequestMapping annotation generated produces for x-accepts as a parameter list instead of a (single) string.

* #18058 Updated test case to accept a string array instead of a comma-separated list.

* #18058 Reverted changes on imported compared to the main branch.

* #18058 getAccepts() is now hybrid, and can return both a single String or a String[].

* #18058 Rolled back the hybrid getAccepts(), so it only returns a String array.

* #18058 Updated mustache files to cope with vendorExtensions.x-accepts being a string array instead of a comma-separated string.

* #18058 Generated new sample files with by running `./bin/generate-samples.sh ./bin/configs/*.yaml`

* #18058 Optimization of getAccepts()

* #18058 Regenerated scripts that got broken after resolving conflicts on GitHub

* #18058 Fixed introduced issue with api.mustache causing a redundant accept with @HttpExchange with the PetApi.java, StoreApi.java, and UserApi.java.
2024-03-21 17:53:18 +08:00
..
2023-03-14 11:36:17 +08:00

JAX-RS server with OpenAPI

Overview

This server was generated by the OpenAPI Generator project. By using an OpenAPI-Spec, you can easily generate a server stub.

This is an example of building a OpenAPI-enabled JAX-RS server. This example uses the JAX-RS framework.

The JAX-RS implementation needs to be provided by the application server you are deploying on.

To run the server from the command line, you can use maven to provision and start a TomEE Server. Please execute the following:

mvn -Dtomee-embedded-plugin.http=8080 package org.apache.tomee.maven:tomee-embedded-maven-plugin:7.0.5:run

You can then call your server endpoints under:

http://localhost:8080/

Note that if you have configured the host to be something other than localhost, the calls through swagger-ui will be directed to that host and not localhost!