[Microprofile] Add option to use tags a client keys and server generator (#16673)

* [Java/Microprofile] Add support for Jackson serialization & async interfaces using Mutiny in Java Microprofile library

* Regenerate samples & docs

* Add server generator

* Update client to set configKey by classname

* Remove debug remains and comments

* Adapt method override to upstream changes

* Regenerate samples

* Revert "Regenerate samples"

This reverts commit b5bcbdea90.

* Move additional 2xx response to dedicated OpenAPI document

Some other generators than those for Micronaut don't seem to be able to
handle this case, so we don't add it to the general pet store document.

* Make filename consistent with other files in the folder

* Regenerate Microprofile client and server samples

* Generate samples

* Update documentation

* Generate samples

* Remove left-over `*.orig` files from Git merges

* Regenerate samples

* Regenerated samples

* changed generator name to "java-microprofile"

* added the new folder to .github/workflows/samples-java-server-jdk8.yaml so that CI will test it moving forward

* Renamed JavaMicroprofileServerCodegen.java

* regenerated samples

* only enable configKeyFromClassName if configKey is not set

* Updated documentation

* Change samples to use junit 4

* Fix junit 4 test classes

* run ensure up-to-date script

* fix kotlin test errors

---------

Co-authored-by: pravussum <pravussum@users.noreply.github.com>
Co-authored-by: frank <frank.buechel@kiwigrid.com>
Co-authored-by: Oscar <oscar.obrien@kiwigrid.com>
Co-authored-by: oscarobr <133783370+oscarobr@users.noreply.github.com>
This commit is contained in:
kiwi-oss
2024-05-07 10:24:23 +02:00
committed by GitHub
parent dc63444789
commit dec8a430df
120 changed files with 7336 additions and 66 deletions

View File

@@ -1,4 +1,4 @@
# OpenAPI Petstore - MicroProfile Rest Client
# OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
@@ -6,3 +6,4 @@ This is a sample server Petstore server. For this sample, you can use the api ke
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
[MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling
REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes.

View File

@@ -125,3 +125,4 @@ public class Category {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -158,3 +158,4 @@ public class ModelApiResponse {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -293,3 +293,4 @@ public class Order {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -323,3 +323,4 @@ public class Pet {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -125,3 +125,4 @@ public class Tag {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -320,3 +320,4 @@ public class User {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -1,4 +1,4 @@
# OpenAPI Petstore - MicroProfile Rest Client
# OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
@@ -6,3 +6,4 @@ This is a sample server Petstore server. For this sample, you can use the api ke
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
[MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling
REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes.

View File

@@ -112,3 +112,4 @@ public class Category {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -143,3 +143,4 @@ public class ModelApiResponse {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -268,3 +268,4 @@ public class Order {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -290,3 +290,4 @@ public class Pet {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -112,3 +112,4 @@ public class Tag {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -295,3 +295,4 @@ public class User {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -1,4 +1,4 @@
# OpenAPI Petstore - MicroProfile Rest Client
# OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
@@ -6,3 +6,4 @@ This is a sample server Petstore server. For this sample, you can use the api ke
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
[MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling
REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes.

View File

@@ -101,3 +101,4 @@ public class Category {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -125,3 +125,4 @@ public class ModelApiResponse {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -243,3 +243,4 @@ public class Order {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -265,3 +265,4 @@ public class Pet {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -101,3 +101,4 @@ public class Tag {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -248,3 +248,4 @@ public class User {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -1,4 +1,4 @@
# OpenAPI Petstore - MicroProfile Rest Client
# OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
@@ -6,3 +6,4 @@ This is a sample server Petstore server. For this sample, you can use the api ke
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
[MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling
REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes.

View File

@@ -101,3 +101,4 @@ public class Category {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -125,3 +125,4 @@ public class ModelApiResponse {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -243,3 +243,4 @@ public class Order {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -265,3 +265,4 @@ public class Pet {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -101,3 +101,4 @@ public class Tag {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -248,3 +248,4 @@ public class User {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -1,4 +1,4 @@
# OpenAPI Petstore - MicroProfile Rest Client
# OpenAPI Petstore - MicroProfile Rest Client & MicroProfile Server
This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
@@ -6,3 +6,4 @@ This is a sample server Petstore server. For this sample, you can use the api ke
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
[MicroProfile Rest Client](https://github.com/eclipse/microprofile-rest-client) is a type-safe way of calling
REST services. The generated client contains an interface which acts as the client, you can inject it into dependent classes.

View File

@@ -17,10 +17,12 @@ All URIs are relative to *http://petstore.swagger.io/v2*
## addPet
> void addPet(body)
> Pet addPet(pet)
Add a new pet to the store
### Example
```java
@@ -42,9 +44,9 @@ public class Example {
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
PetApi apiInstance = new PetApi(defaultClient);
Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store
try {
void result = apiInstance.addPet(body);
Pet result = apiInstance.addPet(pet);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PetApi#addPet");
@@ -62,11 +64,11 @@ public class Example {
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | |
| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | |
### Return type
[**void**](Void.md)
[**Pet**](Pet.md)
### Authorization
@@ -75,12 +77,13 @@ public class Example {
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
| **405** | Invalid input | - |
@@ -90,6 +93,8 @@ public class Example {
Deletes a pet
### Example
```java
@@ -376,10 +381,12 @@ public class Example {
## updatePet
> void updatePet(body)
> Pet updatePet(pet)
Update an existing pet
### Example
```java
@@ -401,9 +408,9 @@ public class Example {
petstore_auth.setAccessToken("YOUR ACCESS TOKEN");
PetApi apiInstance = new PetApi(defaultClient);
Pet body = new Pet(); // Pet | Pet object that needs to be added to the store
Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store
try {
void result = apiInstance.updatePet(body);
Pet result = apiInstance.updatePet(pet);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PetApi#updatePet");
@@ -421,11 +428,11 @@ public class Example {
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | |
| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | |
### Return type
[**void**](Void.md)
[**Pet**](Pet.md)
### Authorization
@@ -434,12 +441,13 @@ public class Example {
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
| **400** | Invalid ID supplied | - |
| **404** | Pet not found | - |
| **405** | Validation exception | - |
@@ -451,6 +459,8 @@ public class Example {
Updates a pet in the store with form data
### Example
```java
@@ -524,6 +534,8 @@ public class Example {
uploads an image
### Example
```java

View File

@@ -217,10 +217,12 @@ No authorization required
## placeOrder
> Order placeOrder(body)
> Order placeOrder(order)
Place an order for a pet
### Example
```java
@@ -237,9 +239,9 @@ public class Example {
defaultClient.setBasePath("http://petstore.swagger.io/v2");
StoreApi apiInstance = new StoreApi(defaultClient);
Order body = new Order(); // Order | order placed for purchasing the pet
Order order = new Order(); // Order | order placed for purchasing the pet
try {
Order result = apiInstance.placeOrder(body);
Order result = apiInstance.placeOrder(order);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling StoreApi#placeOrder");
@@ -257,7 +259,7 @@ public class Example {
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **body** | [**Order**](Order.md)| order placed for purchasing the pet | |
| **order** | [**Order**](Order.md)| order placed for purchasing the pet | |
### Return type
@@ -269,7 +271,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: application/xml, application/json

View File

@@ -17,7 +17,7 @@ All URIs are relative to *http://petstore.swagger.io/v2*
## createUser
> void createUser(body)
> void createUser(user)
Create user
@@ -30,6 +30,7 @@ This can only be done by the logged in user.
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.UserApi;
@@ -37,11 +38,17 @@ public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://petstore.swagger.io/v2");
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
UserApi apiInstance = new UserApi(defaultClient);
User body = new User(); // User | Created user object
User user = new User(); // User | Created user object
try {
void result = apiInstance.createUser(body);
void result = apiInstance.createUser(user);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#createUser");
@@ -59,7 +66,7 @@ public class Example {
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **body** | [**User**](User.md)| Created user object | |
| **user** | [**User**](User.md)| Created user object | |
### Return type
@@ -67,11 +74,11 @@ public class Example {
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
@@ -83,10 +90,12 @@ No authorization required
## createUsersWithArrayInput
> void createUsersWithArrayInput(body)
> void createUsersWithArrayInput(user)
Creates list of users with given input array
### Example
```java
@@ -94,6 +103,7 @@ Creates list of users with given input array
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.UserApi;
@@ -101,11 +111,17 @@ public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://petstore.swagger.io/v2");
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
UserApi apiInstance = new UserApi(defaultClient);
List<User> body = Arrays.asList(); // List<User> | List of user object
List<User> user = Arrays.asList(); // List<User> | List of user object
try {
void result = apiInstance.createUsersWithArrayInput(body);
void result = apiInstance.createUsersWithArrayInput(user);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#createUsersWithArrayInput");
@@ -123,7 +139,7 @@ public class Example {
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **body** | [**List&lt;User&gt;**](User.md)| List of user object | |
| **user** | [**List&lt;User&gt;**](User.md)| List of user object | |
### Return type
@@ -131,11 +147,11 @@ public class Example {
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
@@ -147,10 +163,12 @@ No authorization required
## createUsersWithListInput
> void createUsersWithListInput(body)
> void createUsersWithListInput(user)
Creates list of users with given input array
### Example
```java
@@ -158,6 +176,7 @@ Creates list of users with given input array
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.UserApi;
@@ -165,11 +184,17 @@ public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://petstore.swagger.io/v2");
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
UserApi apiInstance = new UserApi(defaultClient);
List<User> body = Arrays.asList(); // List<User> | List of user object
List<User> user = Arrays.asList(); // List<User> | List of user object
try {
void result = apiInstance.createUsersWithListInput(body);
void result = apiInstance.createUsersWithListInput(user);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#createUsersWithListInput");
@@ -187,7 +212,7 @@ public class Example {
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **body** | [**List&lt;User&gt;**](User.md)| List of user object | |
| **user** | [**List&lt;User&gt;**](User.md)| List of user object | |
### Return type
@@ -195,11 +220,11 @@ public class Example {
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined
@@ -224,6 +249,7 @@ This can only be done by the logged in user.
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.UserApi;
@@ -231,6 +257,12 @@ public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://petstore.swagger.io/v2");
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
UserApi apiInstance = new UserApi(defaultClient);
String username = "username_example"; // String | The name that needs to be deleted
@@ -261,7 +293,7 @@ public class Example {
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
@@ -282,6 +314,8 @@ No authorization required
Get user by user name
### Example
```java
@@ -348,6 +382,8 @@ No authorization required
Logs user into the system
### Example
```java
@@ -405,7 +441,7 @@ No authorization required
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **200** | successful operation | * Set-Cookie - Cookie authentication key for use with the &#x60;api_key&#x60; apiKey authentication. <br> * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **400** | Invalid username/password supplied | - |
@@ -415,6 +451,8 @@ No authorization required
Logs out current logged in user session
### Example
```java
@@ -422,6 +460,7 @@ Logs out current logged in user session
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.UserApi;
@@ -429,6 +468,12 @@ public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://petstore.swagger.io/v2");
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
UserApi apiInstance = new UserApi(defaultClient);
try {
@@ -455,7 +500,7 @@ This endpoint does not need any parameter.
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
@@ -471,7 +516,7 @@ No authorization required
## updateUser
> void updateUser(username, body)
> void updateUser(username, user)
Updated user
@@ -484,6 +529,7 @@ This can only be done by the logged in user.
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.UserApi;
@@ -491,12 +537,18 @@ public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://petstore.swagger.io/v2");
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
UserApi apiInstance = new UserApi(defaultClient);
String username = "username_example"; // String | name that need to be deleted
User body = new User(); // User | Updated user object
User user = new User(); // User | Updated user object
try {
void result = apiInstance.updateUser(username, body);
void result = apiInstance.updateUser(username, user);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling UserApi#updateUser");
@@ -515,7 +567,7 @@ public class Example {
| Name | Type | Description | Notes |
|------------- | ------------- | ------------- | -------------|
| **username** | **String**| name that need to be deleted | |
| **body** | [**User**](User.md)| Updated user object | |
| **user** | [**User**](User.md)| Updated user object | |
### Return type
@@ -523,11 +575,11 @@ public class Example {
### Authorization
No authorization required
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Content-Type**: application/json
- **Accept**: Not defined

View File

@@ -37,7 +37,7 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
*
*/
@RegisterRestClient(configKey="petstore")
@RegisterRestClient(configKey="pet-api")
@RegisterProvider(ApiExceptionMapper.class)
@Path("/pet")
public interface PetApi {
@@ -45,15 +45,20 @@ public interface PetApi {
/**
* Add a new pet to the store
*
*
*
*/
@POST
@Consumes({ "application/json", "application/xml" })
void addPet(Pet body) throws ApiException, ProcessingException;
@Produces({ "application/xml", "application/json" })
Pet addPet(Pet pet) throws ApiException, ProcessingException;
/**
* Deletes a pet
*
*
*
*/
@DELETE
@Path("/{petId}")
@@ -97,15 +102,20 @@ public interface PetApi {
/**
* Update an existing pet
*
*
*
*/
@PUT
@Consumes({ "application/json", "application/xml" })
void updatePet(Pet body) throws ApiException, ProcessingException;
@Produces({ "application/xml", "application/json" })
Pet updatePet(Pet pet) throws ApiException, ProcessingException;
/**
* Updates a pet in the store with form data
*
*
*
*/
@POST
@Path("/{petId}")
@@ -115,6 +125,8 @@ public interface PetApi {
/**
* uploads an image
*
*
*
*/
@POST
@Path("/{petId}/uploadImage")

View File

@@ -35,7 +35,7 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
*
*/
@RegisterRestClient(configKey="petstore")
@RegisterRestClient(configKey="store-api")
@RegisterProvider(ApiExceptionMapper.class)
@Path("/store")
public interface StoreApi {
@@ -75,9 +75,12 @@ public interface StoreApi {
/**
* Place an order for a pet
*
*
*
*/
@POST
@Path("/order")
@Consumes({ "application/json" })
@Produces({ "application/xml", "application/json" })
Order placeOrder(Order body) throws ApiException, ProcessingException;
Order placeOrder(Order order) throws ApiException, ProcessingException;
}

View File

@@ -36,7 +36,7 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
*
*/
@RegisterRestClient(configKey="petstore")
@RegisterRestClient(configKey="user-api")
@RegisterProvider(ApiExceptionMapper.class)
@Path("/user")
public interface UserApi {
@@ -49,23 +49,30 @@ public interface UserApi {
*/
@POST
void createUser(User body) throws ApiException, ProcessingException;
@Consumes({ "application/json" })
void createUser(User user) throws ApiException, ProcessingException;
/**
* Creates list of users with given input array
*
*
*
*/
@POST
@Path("/createWithArray")
void createUsersWithArrayInput(List<User> body) throws ApiException, ProcessingException;
@Consumes({ "application/json" })
void createUsersWithArrayInput(List<User> user) throws ApiException, ProcessingException;
/**
* Creates list of users with given input array
*
*
*
*/
@POST
@Path("/createWithList")
void createUsersWithListInput(List<User> body) throws ApiException, ProcessingException;
@Consumes({ "application/json" })
void createUsersWithListInput(List<User> user) throws ApiException, ProcessingException;
/**
* Delete user
@@ -80,6 +87,8 @@ public interface UserApi {
/**
* Get user by user name
*
*
*
*/
@GET
@Path("/{username}")
@@ -89,6 +98,8 @@ public interface UserApi {
/**
* Logs user into the system
*
*
*
*/
@GET
@Path("/login")
@@ -98,6 +109,8 @@ public interface UserApi {
/**
* Logs out current logged in user session
*
*
*
*/
@GET
@Path("/logout")
@@ -111,5 +124,6 @@ public interface UserApi {
*/
@PUT
@Path("/{username}")
void updateUser(@PathParam("username") String username, User body) throws ApiException, ProcessingException;
@Consumes({ "application/json" })
void updateUser(@PathParam("username") String username, User user) throws ApiException, ProcessingException;
}

View File

@@ -101,3 +101,4 @@ public class Category {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -125,3 +125,4 @@ public class ModelApiResponse {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -243,3 +243,4 @@ public class Order {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -216,7 +216,9 @@ public class Pet {
/**
* pet status in the store
* @return status
* @deprecated
**/
@Deprecated
public StatusEnum getStatus() {
return status;
}
@@ -263,3 +265,4 @@ public class Pet {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -101,3 +101,4 @@ public class Tag {
return o.toString().replace("\n", "\n ");
}
}

View File

@@ -248,3 +248,4 @@ public class User {
return o.toString().replace("\n", "\n ");
}
}