forked from loafle/openapi-generator-original
Javadoc + operations interface + provider for state(ful/less) handlers (#8346)
* Added Javadoc + meta-data about request/response + abstract class. * Added one more method to set base path. * Updated Javadoc for each endpoint. * Shorten the method name displayed in Javadoc. * Fix README grammar. * Separate imports based on type. * Put operations into their own interface class. * Update Javadoc. * Adjust Mustache template to support Java 1.5. * Add import for HttpServerExchange, suppress warning about using a Lambda. * Remove @Override from a mgetStatefulHandler(). * Regenrate the samples.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
README.md
|
||||
pom.xml
|
||||
src/main/java/org/openapitools/handler/PathHandlerInterface.java
|
||||
src/main/java/org/openapitools/handler/PathHandlerProvider.java
|
||||
src/main/java/org/openapitools/model/Category.java
|
||||
src/main/java/org/openapitools/model/ModelApiResponse.java
|
||||
|
||||
@@ -1 +1 @@
|
||||
5.0.0-SNAPSHOT
|
||||
5.0.1-SNAPSHOT
|
||||
@@ -10,15 +10,13 @@ mvn package exec:exec
|
||||
|
||||
## Test
|
||||
|
||||
By default, all endpoints are protected by OAuth jwt token verifier. It can be turned off with config change through for development.
|
||||
|
||||
By default, all endpoints are protected by the OAuth JWT token verifier. It can be turned off with a config change, when required.
|
||||
|
||||
In order to access the server, there is a long lived token below issued by my
|
||||
oauth2 server [undertow-server-oauth2](https://github.com/networknt/undertow-server-oauth2)
|
||||
OAuth2 server [undertow-server-oauth2](https://github.com/networknt/undertow-server-oauth2).
|
||||
|
||||
```
|
||||
Bearer eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJ1cm46Y29tOm5ldHdvcmtudDpvYXV0aDI6djEiLCJhdWQiOiJ1cm46Y29tLm5ldHdvcmtudCIsImV4cCI6MTc4ODEzMjczNSwianRpIjoiNWtyM2ZWOHJaelBZNEJrSnNYZzFpQSIsImlhdCI6MTQ3Mjc3MjczNSwibmJmIjoxNDcyNzcyNjE1LCJ2ZXJzaW9uIjoiMS4wIiwidXNlcl9pZCI6InN0ZXZlIiwidXNlcl90eXBlIjoiRU1QTE9ZRUUiLCJjbGllbnRfaWQiOiJkZGNhZjBiYS0xMTMxLTIyMzItMzMxMy1kNmYyNzUzZjI1ZGMiLCJzY29wZSI6WyJhcGkuciIsImFwaS53Il19.gteJiy1uao8HLeWRljpZxHWUgQfofwmnFP-zv3EPUyXjyCOy3xclnfeTnTE39j8PgBwdFASPcDLLk1YfZJbsU6pLlmYXLtdpHDBsVmIRuch6LFPCVQ3JdqSQVci59OhSK0bBThGWqCD3UzDI_OnX4IVCAahcT9Bu94m5u_H_JNmwDf1XaP3Lt4I34buYMuRD9stchsnZi-tuIRkL13FARm1XA9aPZUMUXFdedBWDXo1zMREQ_qCJXOpaZDJM9Im0rIkq9wTEVU00pbRp_Vcdya3dfkFteBMHiwFVt6VNQaco5BXURDAIzXidwQxNEbX1ek03wra8AIani65ZK7fy_w
|
||||
```
|
||||
|
||||
Add "Authorization" header with value as above token and a dummy message will return from the generated stub.
|
||||
|
||||
|
||||
@@ -0,0 +1,604 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI document version: 1.0.0
|
||||
*
|
||||
*
|
||||
* AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
*/
|
||||
package org.openapitools.handler;
|
||||
|
||||
import io.undertow.server.*;
|
||||
import io.undertow.util.*;
|
||||
|
||||
import org.openapitools.model.*;
|
||||
|
||||
@SuppressWarnings("TooManyFunctions")
|
||||
public interface PathHandlerInterface {
|
||||
|
||||
/**
|
||||
* <p>Add a new pet to the store</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/pet" (<i>privileged: true</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* </ul>
|
||||
*
|
||||
* <p><b>Consumes</b>: [{mediaType=application/json}, {mediaType=application/xml}]</p>
|
||||
* <p><b>Payload</b>: {@link Pet} (<i>required: true</i>)</p>
|
||||
*
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>405 (client error)</b>: Invalid input</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler addPet();
|
||||
|
||||
/**
|
||||
* <p>Deletes a pet</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#DELETE DELETE} "/v2/pet/{petId}" (<i>privileged: true</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* <li>
|
||||
* <p>"<b>petId</b>"
|
||||
* <p>Pet id to delete</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link Long}</b><br/>
|
||||
* - Appears in: <b>{@link HttpServerExchange#getPathParameters Path}</b><br/>
|
||||
* - Required: <b>true</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* <li>
|
||||
* <p>"<b>api_key</b>"
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link String}</b><br/>
|
||||
* - Appears in: <b>{@link Headers Header}</b><br/>
|
||||
* - Required: <b>false</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>400 (client error)</b>: Invalid pet value</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler deletePet();
|
||||
|
||||
/**
|
||||
* <p>Finds Pets by status</p>
|
||||
*
|
||||
* <p>Multiple status values can be provided with comma separated strings</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/pet/findByStatus" (<i>privileged: true</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* <li>
|
||||
* <p>"<b>status</b>"
|
||||
* <p>Status values that need to be considered for filter</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link java.util.List List} of {@link List<String>}</b><br/>
|
||||
* - Appears in: <b>{@link HttpServerExchange#getQueryParameters Query}</b><br/>
|
||||
* - Default value: <b>new ArrayList<String>()</b><br/>
|
||||
* - Required: <b>true</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* <p><b>Produces</b>: [{mediaType=application/xml}, {mediaType=application/json}]</p>
|
||||
* <p><b>Returns</b>: {@link java.util.List List} of {@link Pet}</p>
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>200 (success)</b>: successful operation</li>
|
||||
* <li><b>400 (client error)</b>: Invalid status value</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler findPetsByStatus();
|
||||
|
||||
/**
|
||||
* <p>Finds Pets by tags</p>
|
||||
*
|
||||
* <p>Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/pet/findByTags" (<i>privileged: true</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* <li>
|
||||
* <p>"<b>tags</b>"
|
||||
* <p>Tags to filter by</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link java.util.List List} of {@link List<String>}</b><br/>
|
||||
* - Appears in: <b>{@link HttpServerExchange#getQueryParameters Query}</b><br/>
|
||||
* - Default value: <b>new ArrayList<String>()</b><br/>
|
||||
* - Required: <b>true</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* <p><b>Produces</b>: [{mediaType=application/xml}, {mediaType=application/json}]</p>
|
||||
* <p><b>Returns</b>: {@link java.util.List List} of {@link Pet}</p>
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>200 (success)</b>: successful operation</li>
|
||||
* <li><b>400 (client error)</b>: Invalid tag value</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
@Deprecated
|
||||
HttpHandler findPetsByTags();
|
||||
|
||||
/**
|
||||
* <p>Find pet by ID</p>
|
||||
*
|
||||
* <p>Returns a single pet</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/pet/{petId}" (<i>privileged: true</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* <li>
|
||||
* <p>"<b>petId</b>"
|
||||
* <p>ID of pet to return</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link Long}</b><br/>
|
||||
* - Appears in: <b>{@link HttpServerExchange#getPathParameters Path}</b><br/>
|
||||
* - Required: <b>true</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* <p><b>Produces</b>: [{mediaType=application/xml}, {mediaType=application/json}]</p>
|
||||
* <p><b>Returns</b>: {@link Pet}</p>
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>200 (success)</b>: successful operation</li>
|
||||
* <li><b>400 (client error)</b>: Invalid ID supplied</li>
|
||||
* <li><b>404 (client error)</b>: Pet not found</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler getPetById();
|
||||
|
||||
/**
|
||||
* <p>Update an existing pet</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#PUT PUT} "/v2/pet" (<i>privileged: true</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* </ul>
|
||||
*
|
||||
* <p><b>Consumes</b>: [{mediaType=application/json}, {mediaType=application/xml}]</p>
|
||||
* <p><b>Payload</b>: {@link Pet} (<i>required: true</i>)</p>
|
||||
*
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>400 (client error)</b>: Invalid ID supplied</li>
|
||||
* <li><b>404 (client error)</b>: Pet not found</li>
|
||||
* <li><b>405 (client error)</b>: Validation exception</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler updatePet();
|
||||
|
||||
/**
|
||||
* <p>Updates a pet in the store with form data</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/pet/{petId}" (<i>privileged: true</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* <li>
|
||||
* <p>"<b>petId</b>"
|
||||
* <p>ID of pet that needs to be updated</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link Long}</b><br/>
|
||||
* - Appears in: <b>{@link HttpServerExchange#getPathParameters Path}</b><br/>
|
||||
* - Required: <b>true</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* <li>
|
||||
* <p>"<b>name</b>"
|
||||
* <p>Updated name of the pet</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link String}</b><br/>
|
||||
* - Appears in: <b>{@link io.undertow.server.handlers.form.FormDataParser Form}</b><br/>
|
||||
* - Required: <b>false</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* <li>
|
||||
* <p>"<b>status</b>"
|
||||
* <p>Updated status of the pet</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link String}</b><br/>
|
||||
* - Appears in: <b>{@link io.undertow.server.handlers.form.FormDataParser Form}</b><br/>
|
||||
* - Required: <b>false</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* <p><b>Consumes</b>: [{mediaType=application/x-www-form-urlencoded}]</p>
|
||||
*
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>405 (client error)</b>: Invalid input</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler updatePetWithForm();
|
||||
|
||||
/**
|
||||
* <p>uploads an image</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/pet/{petId}/uploadImage" (<i>privileged: true</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* <li>
|
||||
* <p>"<b>petId</b>"
|
||||
* <p>ID of pet to update</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link Long}</b><br/>
|
||||
* - Appears in: <b>{@link HttpServerExchange#getPathParameters Path}</b><br/>
|
||||
* - Required: <b>true</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* <li>
|
||||
* <p>"<b>additionalMetadata</b>"
|
||||
* <p>Additional data to pass to server</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link String}</b><br/>
|
||||
* - Appears in: <b>{@link io.undertow.server.handlers.form.FormDataParser Form}</b><br/>
|
||||
* - Required: <b>false</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* <li>
|
||||
* <p>"<b>file</b>"
|
||||
* <p>file to upload</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>BinaryFile</b><br/>
|
||||
* - Appears in: <b>{@link io.undertow.server.handlers.form.FormDataParser Form}</b><br/>
|
||||
* - Required: <b>false</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* <p><b>Consumes</b>: [{mediaType=multipart/form-data}]</p>
|
||||
*
|
||||
* <p><b>Produces</b>: [{mediaType=application/json}]</p>
|
||||
* <p><b>Returns</b>: {@link ModelApiResponse}</p>
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>200 (success)</b>: successful operation</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler uploadFile();
|
||||
|
||||
/**
|
||||
* <p>Delete purchase order by ID</p>
|
||||
*
|
||||
* <p>For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#DELETE DELETE} "/v2/store/order/{orderId}" (<i>privileged: false</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* <li>
|
||||
* <p>"<b>orderId</b>"
|
||||
* <p>ID of the order that needs to be deleted</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link String}</b><br/>
|
||||
* - Appears in: <b>{@link HttpServerExchange#getPathParameters Path}</b><br/>
|
||||
* - Required: <b>true</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>400 (client error)</b>: Invalid ID supplied</li>
|
||||
* <li><b>404 (client error)</b>: Order not found</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler deleteOrder();
|
||||
|
||||
/**
|
||||
* <p>Returns pet inventories by status</p>
|
||||
*
|
||||
* <p>Returns a map of status codes to quantities</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/store/inventory" (<i>privileged: true</i>)</p>
|
||||
*
|
||||
* <p><b>Produces</b>: [{mediaType=application/json}]</p>
|
||||
* <p><b>Returns</b>: {@link java.util.Map Map} of {@link Integer}</p>
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>200 (success)</b>: successful operation</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler getInventory();
|
||||
|
||||
/**
|
||||
* <p>Find purchase order by ID</p>
|
||||
*
|
||||
* <p>For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/store/order/{orderId}" (<i>privileged: false</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* <li>
|
||||
* <p>"<b>orderId</b>"
|
||||
* <p>ID of pet that needs to be fetched</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link Long}</b><br/>
|
||||
* - Appears in: <b>{@link HttpServerExchange#getPathParameters Path}</b><br/>
|
||||
* - Required: <b>true</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* <p><b>Produces</b>: [{mediaType=application/xml}, {mediaType=application/json}]</p>
|
||||
* <p><b>Returns</b>: {@link Order}</p>
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>200 (success)</b>: successful operation</li>
|
||||
* <li><b>400 (client error)</b>: Invalid ID supplied</li>
|
||||
* <li><b>404 (client error)</b>: Order not found</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler getOrderById();
|
||||
|
||||
/**
|
||||
* <p>Place an order for a pet</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/store/order" (<i>privileged: false</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* </ul>
|
||||
*
|
||||
* <p><b>Produces</b>: [{mediaType=application/xml}, {mediaType=application/json}]</p>
|
||||
* <p><b>Returns</b>: {@link Order}</p>
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>200 (success)</b>: successful operation</li>
|
||||
* <li><b>400 (client error)</b>: Invalid Order</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler placeOrder();
|
||||
|
||||
/**
|
||||
* <p>Create user</p>
|
||||
*
|
||||
* <p>This can only be done by the logged in user.</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user" (<i>privileged: false</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* </ul>
|
||||
*
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>Default</b>: successful operation</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler createUser();
|
||||
|
||||
/**
|
||||
* <p>Creates list of users with given input array</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user/createWithArray" (<i>privileged: false</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* </ul>
|
||||
*
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>Default</b>: successful operation</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler createUsersWithArrayInput();
|
||||
|
||||
/**
|
||||
* <p>Creates list of users with given input array</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#POST POST} "/v2/user/createWithList" (<i>privileged: false</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* </ul>
|
||||
*
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>Default</b>: successful operation</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler createUsersWithListInput();
|
||||
|
||||
/**
|
||||
* <p>Delete user</p>
|
||||
*
|
||||
* <p>This can only be done by the logged in user.</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#DELETE DELETE} "/v2/user/{username}" (<i>privileged: false</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* <li>
|
||||
* <p>"<b>username</b>"
|
||||
* <p>The name that needs to be deleted</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link String}</b><br/>
|
||||
* - Appears in: <b>{@link HttpServerExchange#getPathParameters Path}</b><br/>
|
||||
* - Required: <b>true</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>400 (client error)</b>: Invalid username supplied</li>
|
||||
* <li><b>404 (client error)</b>: User not found</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler deleteUser();
|
||||
|
||||
/**
|
||||
* <p>Get user by user name</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/{username}" (<i>privileged: false</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* <li>
|
||||
* <p>"<b>username</b>"
|
||||
* <p>The name that needs to be fetched. Use user1 for testing.</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link String}</b><br/>
|
||||
* - Appears in: <b>{@link HttpServerExchange#getPathParameters Path}</b><br/>
|
||||
* - Required: <b>true</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* <p><b>Produces</b>: [{mediaType=application/xml}, {mediaType=application/json}]</p>
|
||||
* <p><b>Returns</b>: {@link User}</p>
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>200 (success)</b>: successful operation</li>
|
||||
* <li><b>400 (client error)</b>: Invalid username supplied</li>
|
||||
* <li><b>404 (client error)</b>: User not found</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler getUserByName();
|
||||
|
||||
/**
|
||||
* <p>Logs user into the system</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/login" (<i>privileged: false</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* <li>
|
||||
* <p>"<b>username</b>"
|
||||
* <p>The user name for login</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link String}</b><br/>
|
||||
* - Appears in: <b>{@link HttpServerExchange#getQueryParameters Query}</b><br/>
|
||||
* - Required: <b>true</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* <li>
|
||||
* <p>"<b>password</b>"
|
||||
* <p>The password for login in clear text</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link String}</b><br/>
|
||||
* - Appears in: <b>{@link HttpServerExchange#getQueryParameters Query}</b><br/>
|
||||
* - Required: <b>true</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* </ul>
|
||||
* <p><b>Response headers</b>: [CodegenProperty{openApiType='integer', baseName='X-Rate-Limit', complexType='null', getter='getxRateLimit', setter='setxRateLimit', description='calls per hour allowed by the user', dataType='Integer', datatypeWithEnum='Integer', dataFormat='int32', name='xRateLimit', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Rate-Limit;', baseType='Integer', containerType='null', title='null', unescapedDescription='calls per hour allowed by the user', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{
|
||||
"type" : "integer",
|
||||
"format" : "int32"
|
||||
}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=false, isNumeric=true, isInteger=true, isLong=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='XRateLimit', nameInSnakeCase='X_RATE_LIMIT', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false}, CodegenProperty{openApiType='string', baseName='X-Expires-After', complexType='Date', getter='getxExpiresAfter', setter='setxExpiresAfter', description='date in UTC when toekn expires', dataType='Date', datatypeWithEnum='Date', dataFormat='date-time', name='xExpiresAfter', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Expires-After;', baseType='Date', containerType='null', title='null', unescapedDescription='date in UTC when toekn expires', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{
|
||||
"type" : "string",
|
||||
"format" : "date-time"
|
||||
}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=false, isModel=false, isContainer=false, isString=false, isNumeric=false, isInteger=false, isLong=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=true, isUuid=false, isUri=false, isEmail=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='XExpiresAfter', nameInSnakeCase='X_EXPIRES_AFTER', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false}]</p>
|
||||
*
|
||||
* <p><b>Produces</b>: [{mediaType=application/xml}, {mediaType=application/json}]</p>
|
||||
* <p><b>Returns</b>: {@link String}</p>
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>200 (success)</b>: successful operation</li>
|
||||
* <li><b>400 (client error)</b>: Invalid username/password supplied</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler loginUser();
|
||||
|
||||
/**
|
||||
* <p>Logs out current logged in user session</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#GET GET} "/v2/user/logout" (<i>privileged: false</i>)</p>
|
||||
*
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>Default</b>: successful operation</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler logoutUser();
|
||||
|
||||
/**
|
||||
* <p>Updated user</p>
|
||||
*
|
||||
* <p>This can only be done by the logged in user.</p>
|
||||
*
|
||||
* <p><b>Endpoint</b>: {@link Methods#PUT PUT} "/v2/user/{username}" (<i>privileged: false</i>)</p>
|
||||
*
|
||||
* <p><b>Request parameters</b>:</p>
|
||||
* <ul>
|
||||
* <li>
|
||||
* <p>"<b>username</b>"
|
||||
* <p>name that need to be deleted</p>
|
||||
* <p>
|
||||
* - Parameter type: <b>{@link String}</b><br/>
|
||||
* - Appears in: <b>{@link HttpServerExchange#getPathParameters Path}</b><br/>
|
||||
* - Required: <b>true</b>
|
||||
* </p>
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
*
|
||||
* <p><b>Responses</b>:</p>
|
||||
* <ul>
|
||||
* <li><b>400 (client error)</b>: Invalid user supplied</li>
|
||||
* <li><b>404 (client error)</b>: User not found</li>
|
||||
* </ul>
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
HttpHandler updateUser();
|
||||
}
|
||||
@@ -1,159 +1,287 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI document version: 1.0.0
|
||||
*
|
||||
*
|
||||
* AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
*/
|
||||
package org.openapitools.handler;
|
||||
|
||||
import com.networknt.config.Config;
|
||||
import com.networknt.server.HandlerProvider;
|
||||
import io.undertow.Handlers;
|
||||
import io.undertow.server.HttpHandler;
|
||||
import io.undertow.server.HttpServerExchange;
|
||||
import io.undertow.server.RoutingHandler;
|
||||
import io.undertow.server.handlers.PathHandler;
|
||||
import io.undertow.util.Methods;
|
||||
|
||||
public class PathHandlerProvider implements HandlerProvider {
|
||||
/**
|
||||
* The default implementation for {@link HandlerProvider} and {@link PathHandlerInterface}.
|
||||
*
|
||||
* <p>There are two flavors of {@link HttpHandler}s to choose from, depending on your needs:</p>
|
||||
*
|
||||
* <ul>
|
||||
* <li>
|
||||
* <b>Stateless</b>: if a specific endpoint is called more than once from multiple sessions,
|
||||
* its state is not retained – a different {@link HttpHandler} is instantiated for every new
|
||||
* session. This is the default behavior.
|
||||
* </li>
|
||||
* <li>
|
||||
* <b>Stateful</b>: if a specific endpoint is called more than once from multiple sessions,
|
||||
* its state is retained properly. For example, if you want to keep a class property that counts
|
||||
* the number of requests or the last time a request was received.
|
||||
* </li>
|
||||
* </ul>
|
||||
* <p>Note: <b>Stateful</b> flavor is more performant than <b>Stateless</b>.</p>
|
||||
*/
|
||||
@SuppressWarnings("TooManyFunctions")
|
||||
abstract public class PathHandlerProvider implements HandlerProvider, PathHandlerInterface {
|
||||
/**
|
||||
* Returns the default base path to access this server.
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
public String getBasePath() {
|
||||
return "/v2";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a stateless {@link HttpHandler} that configures all endpoints in this server.
|
||||
*
|
||||
* <p>Endpoints bound in this method do NOT start with "/v2", and
|
||||
* it's your responsibility to configure a {@link PathHandler} with a prefix path
|
||||
* by calling {@link PathHandler#addPrefixPath} like so:</p>
|
||||
*
|
||||
* <code>pathHandler.addPrefixPath("/v2", handler)</code>
|
||||
*
|
||||
* <p>Note: the endpoints bound to the returned {@link HttpHandler} are stateless and won't
|
||||
* retain any state between multiple sessions.</p>
|
||||
*
|
||||
* @return an {@link HttpHandler} of type {@link RoutingHandler}
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
@Override
|
||||
public HttpHandler getHandler() {
|
||||
HttpHandler handler = Handlers.routing()
|
||||
return getHandler(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a stateless {@link HttpHandler} that configures all endpoints in this server.
|
||||
*
|
||||
* <p>Note: the endpoints bound to the returned {@link HttpHandler} are stateless and won't
|
||||
* retain any state between multiple sessions.</p>
|
||||
*
|
||||
* @param withBasePath if true, all endpoints would start with "/v2"
|
||||
* @return an {@link HttpHandler} of type {@link RoutingHandler}
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
public HttpHandler getHandler(final boolean withBasePath) {
|
||||
return getHandler(withBasePath ? getBasePath() : "");
|
||||
}
|
||||
|
||||
.add(Methods.POST, "/v2/pet", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("addPet");
|
||||
}
|
||||
})
|
||||
/**
|
||||
* Returns a stateless {@link HttpHandler} that configures all endpoints in this server.
|
||||
*
|
||||
* <p>Note: the endpoints bound to the returned {@link HttpHandler} are stateless and won't
|
||||
* retain any state between multiple sessions.</p>
|
||||
*
|
||||
* @param basePath base path to set for all endpoints
|
||||
* @return an {@link HttpHandler} of type {@link RoutingHandler}
|
||||
*/
|
||||
@SuppressWarnings("Convert2Lambda")
|
||||
@javax.annotation.Nonnull
|
||||
public HttpHandler getHandler(final String basePath) {
|
||||
return Handlers.routing()
|
||||
.add(Methods.POST, basePath + "/pet", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
addPet().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.DELETE, basePath + "/pet/{petId}", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
deletePet().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.GET, basePath + "/pet/findByStatus", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
findPetsByStatus().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.GET, basePath + "/pet/findByTags", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
findPetsByTags().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.GET, basePath + "/pet/{petId}", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
getPetById().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.PUT, basePath + "/pet", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
updatePet().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.POST, basePath + "/pet/{petId}", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
updatePetWithForm().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.POST, basePath + "/pet/{petId}/uploadImage", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
uploadFile().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.DELETE, basePath + "/store/order/{orderId}", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
deleteOrder().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.GET, basePath + "/store/inventory", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
getInventory().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.GET, basePath + "/store/order/{orderId}", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
getOrderById().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.POST, basePath + "/store/order", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
placeOrder().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.POST, basePath + "/user", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
createUser().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.POST, basePath + "/user/createWithArray", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
createUsersWithArrayInput().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.POST, basePath + "/user/createWithList", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
createUsersWithListInput().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.DELETE, basePath + "/user/{username}", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
deleteUser().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.GET, basePath + "/user/{username}", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
getUserByName().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.GET, basePath + "/user/login", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
loginUser().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.GET, basePath + "/user/logout", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
logoutUser().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
.add(Methods.PUT, basePath + "/user/{username}", new HttpHandler() {
|
||||
@Override
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
updateUser().handleRequest(exchange);
|
||||
}
|
||||
})
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a stateful {@link HttpHandler} that configures all endpoints in this server.
|
||||
*
|
||||
* <p>Endpoints bound in this method do NOT start with "/v2", and
|
||||
* it's your responsibility to configure a {@link PathHandler} with a prefix path
|
||||
* by calling {@link PathHandler#addPrefixPath} like so:</p>
|
||||
*
|
||||
* <code>pathHandler.addPrefixPath("/v2", handler)</code>
|
||||
*
|
||||
* <p>Note: the endpoints bound to the returned {@link HttpHandler} are stateful and will
|
||||
* retain any state between multiple sessions.</p>
|
||||
*
|
||||
* @return an {@link HttpHandler} of type {@link RoutingHandler}
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
public HttpHandler getStatefulHandler() {
|
||||
return getStatefulHandler(false);
|
||||
}
|
||||
|
||||
.add(Methods.DELETE, "/v2/pet/{petId}", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("deletePet");
|
||||
}
|
||||
})
|
||||
/**
|
||||
* Returns a stateful {@link HttpHandler} that configures all endpoints in this server.
|
||||
*
|
||||
* <p>Note: the endpoints bound to the returned {@link HttpHandler} are stateful and will
|
||||
* retain any state between multiple sessions.</p>
|
||||
*
|
||||
* @param withBasePath if true, all endpoints would start with "/v2"
|
||||
* @return an {@link HttpHandler} of type {@link RoutingHandler}
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
public HttpHandler getStatefulHandler(final boolean withBasePath) {
|
||||
return getStatefulHandler(withBasePath ? getBasePath() : "");
|
||||
}
|
||||
|
||||
|
||||
.add(Methods.GET, "/v2/pet/findByStatus", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("findPetsByStatus");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.GET, "/v2/pet/findByTags", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("findPetsByTags");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.GET, "/v2/pet/{petId}", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("getPetById");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.PUT, "/v2/pet", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("updatePet");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.POST, "/v2/pet/{petId}", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("updatePetWithForm");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.POST, "/v2/pet/{petId}/uploadImage", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("uploadFile");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.DELETE, "/v2/store/order/{orderId}", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("deleteOrder");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.GET, "/v2/store/inventory", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("getInventory");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.GET, "/v2/store/order/{orderId}", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("getOrderById");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.POST, "/v2/store/order", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("placeOrder");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.POST, "/v2/user", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("createUser");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.POST, "/v2/user/createWithArray", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("createUsersWithArrayInput");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.POST, "/v2/user/createWithList", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("createUsersWithListInput");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.DELETE, "/v2/user/{username}", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("deleteUser");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.GET, "/v2/user/{username}", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("getUserByName");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.GET, "/v2/user/login", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("loginUser");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.GET, "/v2/user/logout", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("logoutUser");
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
.add(Methods.PUT, "/v2/user/{username}", new HttpHandler() {
|
||||
public void handleRequest(HttpServerExchange exchange) throws Exception {
|
||||
exchange.getResponseSender().send("updateUser");
|
||||
}
|
||||
})
|
||||
|
||||
;
|
||||
return handler;
|
||||
/**
|
||||
* Returns a stateful {@link HttpHandler} that configures all endpoints in this server.
|
||||
*
|
||||
* <p>Note: the endpoints bound to the returned {@link HttpHandler} are stateful and will
|
||||
* retain any state between multiple sessions.</p>
|
||||
*
|
||||
* @param basePath base path to set for all endpoints
|
||||
* @return an {@link HttpHandler} of type {@link RoutingHandler}
|
||||
*/
|
||||
@javax.annotation.Nonnull
|
||||
public HttpHandler getStatefulHandler(final String basePath) {
|
||||
return Handlers.routing()
|
||||
.add(Methods.POST, basePath + "/pet", addPet())
|
||||
.add(Methods.DELETE, basePath + "/pet/{petId}", deletePet())
|
||||
.add(Methods.GET, basePath + "/pet/findByStatus", findPetsByStatus())
|
||||
.add(Methods.GET, basePath + "/pet/findByTags", findPetsByTags())
|
||||
.add(Methods.GET, basePath + "/pet/{petId}", getPetById())
|
||||
.add(Methods.PUT, basePath + "/pet", updatePet())
|
||||
.add(Methods.POST, basePath + "/pet/{petId}", updatePetWithForm())
|
||||
.add(Methods.POST, basePath + "/pet/{petId}/uploadImage", uploadFile())
|
||||
.add(Methods.DELETE, basePath + "/store/order/{orderId}", deleteOrder())
|
||||
.add(Methods.GET, basePath + "/store/inventory", getInventory())
|
||||
.add(Methods.GET, basePath + "/store/order/{orderId}", getOrderById())
|
||||
.add(Methods.POST, basePath + "/store/order", placeOrder())
|
||||
.add(Methods.POST, basePath + "/user", createUser())
|
||||
.add(Methods.POST, basePath + "/user/createWithArray", createUsersWithArrayInput())
|
||||
.add(Methods.POST, basePath + "/user/createWithList", createUsersWithListInput())
|
||||
.add(Methods.DELETE, basePath + "/user/{username}", deleteUser())
|
||||
.add(Methods.GET, basePath + "/user/{username}", getUserByName())
|
||||
.add(Methods.GET, basePath + "/user/login", loginUser())
|
||||
.add(Methods.GET, basePath + "/user/logout", logoutUser())
|
||||
.add(Methods.PUT, basePath + "/user/{username}", updateUser())
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI document version: 1.0.0
|
||||
*
|
||||
*
|
||||
* AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
*/
|
||||
package org.openapitools.model;
|
||||
|
||||
import java.util.Objects;
|
||||
@@ -10,7 +20,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A category for a pet
|
||||
**/
|
||||
*/
|
||||
|
||||
@ApiModel(description = "A category for a pet")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen")
|
||||
@@ -20,7 +30,7 @@ public class Category {
|
||||
private String name;
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public Category id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
@@ -37,7 +47,7 @@ public class Category {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public Category name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI document version: 1.0.0
|
||||
*
|
||||
*
|
||||
* AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
*/
|
||||
package org.openapitools.model;
|
||||
|
||||
import java.util.Objects;
|
||||
@@ -10,7 +20,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Describes the result of uploading an image resource
|
||||
**/
|
||||
*/
|
||||
|
||||
@ApiModel(description = "Describes the result of uploading an image resource")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen")
|
||||
@@ -21,7 +31,7 @@ public class ModelApiResponse {
|
||||
private String message;
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public ModelApiResponse code(Integer code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
@@ -38,7 +48,7 @@ public class ModelApiResponse {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public ModelApiResponse type(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
@@ -55,7 +65,7 @@ public class ModelApiResponse {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public ModelApiResponse message(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI document version: 1.0.0
|
||||
*
|
||||
*
|
||||
* AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
*/
|
||||
package org.openapitools.model;
|
||||
|
||||
import java.util.Objects;
|
||||
@@ -12,7 +22,7 @@ import java.util.Date;
|
||||
|
||||
/**
|
||||
* An order for a pets from the pet store
|
||||
**/
|
||||
*/
|
||||
|
||||
@ApiModel(description = "An order for a pets from the pet store")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen")
|
||||
@@ -46,7 +56,7 @@ public class Order {
|
||||
private Boolean complete = false;
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public Order id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
@@ -63,7 +73,7 @@ public class Order {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public Order petId(Long petId) {
|
||||
this.petId = petId;
|
||||
return this;
|
||||
@@ -80,7 +90,7 @@ public class Order {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public Order quantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
return this;
|
||||
@@ -97,7 +107,7 @@ public class Order {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public Order shipDate(Date shipDate) {
|
||||
this.shipDate = shipDate;
|
||||
return this;
|
||||
@@ -115,7 +125,7 @@ public class Order {
|
||||
|
||||
/**
|
||||
* Order Status
|
||||
**/
|
||||
*/
|
||||
public Order status(StatusEnum status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
@@ -132,7 +142,7 @@ public class Order {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public Order complete(Boolean complete) {
|
||||
this.complete = complete;
|
||||
return this;
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI document version: 1.0.0
|
||||
*
|
||||
*
|
||||
* AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
*/
|
||||
package org.openapitools.model;
|
||||
|
||||
import java.util.Objects;
|
||||
@@ -15,7 +25,7 @@ import org.openapitools.model.Tag;
|
||||
|
||||
/**
|
||||
* A pet for sale in the pet store
|
||||
**/
|
||||
*/
|
||||
|
||||
@ApiModel(description = "A pet for sale in the pet store")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen")
|
||||
@@ -49,7 +59,7 @@ public class Pet {
|
||||
private StatusEnum status;
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public Pet id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
@@ -66,7 +76,7 @@ public class Pet {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public Pet category(Category category) {
|
||||
this.category = category;
|
||||
return this;
|
||||
@@ -83,7 +93,7 @@ public class Pet {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public Pet name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
@@ -100,7 +110,7 @@ public class Pet {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public Pet photoUrls(List<String> photoUrls) {
|
||||
this.photoUrls = photoUrls;
|
||||
return this;
|
||||
@@ -117,7 +127,7 @@ public class Pet {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public Pet tags(List<Tag> tags) {
|
||||
this.tags = tags;
|
||||
return this;
|
||||
@@ -135,7 +145,7 @@ public class Pet {
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
**/
|
||||
*/
|
||||
public Pet status(StatusEnum status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI document version: 1.0.0
|
||||
*
|
||||
*
|
||||
* AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
*/
|
||||
package org.openapitools.model;
|
||||
|
||||
import java.util.Objects;
|
||||
@@ -10,7 +20,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A tag for a pet
|
||||
**/
|
||||
*/
|
||||
|
||||
@ApiModel(description = "A tag for a pet")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen")
|
||||
@@ -20,7 +30,7 @@ public class Tag {
|
||||
private String name;
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public Tag id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
@@ -37,7 +47,7 @@ public class Tag {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public Tag name(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
/*
|
||||
* OpenAPI Petstore
|
||||
*
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI document version: 1.0.0
|
||||
*
|
||||
*
|
||||
* AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
*/
|
||||
package org.openapitools.model;
|
||||
|
||||
import java.util.Objects;
|
||||
@@ -10,7 +20,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A User who is purchasing from the pet store
|
||||
**/
|
||||
*/
|
||||
|
||||
@ApiModel(description = "A User who is purchasing from the pet store")
|
||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaUndertowServerCodegen")
|
||||
@@ -26,7 +36,7 @@ public class User {
|
||||
private Integer userStatus;
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public User id(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
@@ -43,7 +53,7 @@ public class User {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public User username(String username) {
|
||||
this.username = username;
|
||||
return this;
|
||||
@@ -60,7 +70,7 @@ public class User {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public User firstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
return this;
|
||||
@@ -77,7 +87,7 @@ public class User {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public User lastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
return this;
|
||||
@@ -94,7 +104,7 @@ public class User {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public User email(String email) {
|
||||
this.email = email;
|
||||
return this;
|
||||
@@ -111,7 +121,7 @@ public class User {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public User password(String password) {
|
||||
this.password = password;
|
||||
return this;
|
||||
@@ -128,7 +138,7 @@ public class User {
|
||||
}
|
||||
|
||||
/**
|
||||
**/
|
||||
*/
|
||||
public User phone(String phone) {
|
||||
this.phone = phone;
|
||||
return this;
|
||||
@@ -146,7 +156,7 @@ public class User {
|
||||
|
||||
/**
|
||||
* User Status
|
||||
**/
|
||||
*/
|
||||
public User userStatus(Integer userStatus) {
|
||||
this.userStatus = userStatus;
|
||||
return this;
|
||||
|
||||
@@ -1037,5 +1037,6 @@
|
||||
"type" : "apiKey"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"x-original-swagger-version" : "2.0"
|
||||
}
|
||||
Reference in New Issue
Block a user