forked from loafle/openapi-generator-original
* Create initial version of openapi micronaut generator * Update validation, authorization, query parameters and time format * Move micronaut to its own generator * Add micronaut documentation * Refactor and add tests to JavaMicronautClientGenerator * Refactor model mustache for micronaut client * Refactor model enum and pojo mustache files for micronaut client * Move micronaut client generation to micronaut 3.0.0-M5 version * Generate samples for micronaut client * Add hidden files of generated samples for micronaut client * Add and configure micronaut tests as maven profile * Add option to choose between junit and spock for micronaut client generator * Add tests for micronaut 'build' and 'test' options; regenerate micronaut samples
7.2 KiB
7.2 KiB
PetApi
All URIs are relative to http://petstore.swagger.io:80/v2
Method | HTTP request | Description |
---|---|---|
addPet | POST /pet | Add a new pet to the store |
deletePet | DELETE /pet/{petId} | Deletes a pet |
findPetsByStatus | GET /pet/findByStatus | Finds Pets by status |
findPetsByTags | GET /pet/findByTags | Finds Pets by tags |
getPetById | GET /pet/{petId} | Find pet by ID |
updatePet | PUT /pet | Update an existing pet |
updatePetWithForm | POST /pet/{petId} | Updates a pet in the store with form data |
uploadFile | POST /pet/{petId}/uploadImage | uploads an image |
uploadFileWithRequiredFile | POST /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) |
Creating PetApi
To initiate an instance of PetApi
, you can use micronaut's ApplicationContext
:
/* imports
import io.micronaut.runtime.Micronaut;
import io.micronaut.context.ApplicationContext;
import org.openapitools.api.PetApi;
*/
ApplicationContext context = Micronaut.run(/* ... */);
PetApi apiInstance = context.getBean(PetApi.class);
Or the @Inject
annotation:
@Singleton
class MyClass {
@Inject
PetApi petApi;
/* ... use the injected variable */
}
Note that the class needs to be annotated with one of Micronaut's scope annotations like Singleton
in order to be processed.
More information can be found inside Inversion of Control guide section.
addPet
Mono<Void> PetApi.addPet(_body)
Add a new pet to the store
Parameters
Name | Type | Description | Notes |
---|---|---|---|
_body | Pet | Pet object that needs to be added to the store |
Authorization
- petstore_auth, scopes:
write:pets
,read:pets
HTTP request headers
- Content-Type:
application/json
,application/xml
- Accept: Not defined
deletePet
Mono<Void> PetApi.deletePet(petIdapiKey)
Deletes a pet
Parameters
Name | Type | Description | Notes |
---|---|---|---|
petId | Long |
Pet id to delete | |
apiKey | String |
[optional parameter] |
Authorization
- petstore_auth, scopes:
write:pets
,read:pets
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
findPetsByStatus
Mono<List<Pet>> PetApi.findPetsByStatus(status)
Finds Pets by status
Multiple status values can be provided with comma separated strings
Parameters
Name | Type | Description | Notes |
---|---|---|---|
status | List<String> | Status values that need to be considered for filter | [enum: available , pending , sold ] |
Return type
Authorization
- petstore_auth, scopes:
write:pets
,read:pets
HTTP request headers
- Content-Type: Not defined
- Accept:
application/xml
,application/json
findPetsByTags
Mono<Set<Pet>> PetApi.findPetsByTags(tags)
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Parameters
Name | Type | Description | Notes |
---|---|---|---|
tags | Set<String> | Tags to filter by |
Return type
Authorization
- petstore_auth, scopes:
write:pets
,read:pets
HTTP request headers
- Content-Type: Not defined
- Accept:
application/xml
,application/json
getPetById
Mono<Pet> PetApi.getPetById(petId)
Find pet by ID
Returns a single pet
Parameters
Name | Type | Description | Notes |
---|---|---|---|
petId | Long |
ID of pet to return |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept:
application/xml
,application/json
updatePet
Mono<Void> PetApi.updatePet(_body)
Update an existing pet
Parameters
Name | Type | Description | Notes |
---|---|---|---|
_body | Pet | Pet object that needs to be added to the store |
Authorization
- petstore_auth, scopes:
write:pets
,read:pets
HTTP request headers
- Content-Type:
application/json
,application/xml
- Accept: Not defined
updatePetWithForm
Mono<Void> PetApi.updatePetWithForm(petIdnamestatus)
Updates a pet in the store with form data
Parameters
Name | Type | Description | Notes |
---|---|---|---|
petId | Long |
ID of pet that needs to be updated | |
name | String |
Updated name of the pet | [optional parameter] |
status | String |
Updated status of the pet | [optional parameter] |
Authorization
- petstore_auth, scopes:
write:pets
,read:pets
HTTP request headers
- Content-Type:
application/x-www-form-urlencoded
- Accept: Not defined
uploadFile
Mono<ModelApiResponse> PetApi.uploadFile(petIdadditionalMetadatafile)
uploads an image
Parameters
Name | Type | Description | Notes |
---|---|---|---|
petId | Long |
ID of pet to update | |
additionalMetadata | String |
Additional data to pass to server | [optional parameter] |
file | File |
file to upload | [optional parameter] |
Return type
Authorization
- petstore_auth, scopes:
write:pets
,read:pets
HTTP request headers
- Content-Type:
multipart/form-data
- Accept:
application/json
uploadFileWithRequiredFile
Mono<ModelApiResponse> PetApi.uploadFileWithRequiredFile(petIdrequiredFileadditionalMetadata)
uploads an image (required)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
petId | Long |
ID of pet to update | |
requiredFile | File |
file to upload | |
additionalMetadata | String |
Additional data to pass to server | [optional parameter] |
Return type
Authorization
- petstore_auth, scopes:
write:pets
,read:pets
HTTP request headers
- Content-Type:
multipart/form-data
- Accept:
application/json