Skip to content

Commit

Permalink
[18929] added sample config and (re)generated samples
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrej-simon committed Jun 25, 2024
1 parent 49279ab commit 57117e6
Show file tree
Hide file tree
Showing 83 changed files with 3,548 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,27 @@ paths:
'application/json':
schema:
$ref: '#/components/schemas/Bar'
/park-persons:
post:
tags:
- PerkPerson
summary: Create a Park Person
operationId: createParkPerson
requestBody:
required: true
content:
'application/json':
schema:
oneOf:
- $ref: '#/components/schemas/CreateParkAnimalCarerPerson'
- $ref: '#/components/schemas/CreateParkVisitorPerson'
responses:
201:
description: Park Person created
content:
'application/json':
schema:
type: string

components:
schemas:
Expand Down Expand Up @@ -209,6 +230,53 @@ components:
properties:
length:
type: integer
AbstractAnimal:
type: object
discriminator:
propertyName: type
mapping:
CAT: '#/components/schemas/Cat'
NESTED_TWO: '#/components/schemas/Dog'
required:
- type
properties:
type:
type: string
Cat:
type: object
allOf:
- $ref: '#/components/schemas/AbstractAnimal'
AbstractCreateParkPerson:
type: object
discriminator:
propertyName: type
mapping:
VISITOR: '#/components/schemas/CreateParkVisitorPerson'
ANIMAL_CARER: '#/components/schemas/CreateParkAnimalCarerPerson'
required:
- type
properties:
type:
type: string
CreateParkAnimalCarerPerson:
type: object
allOf:
- $ref: '#/components/schemas/AbstractCreateParkPerson'
required:
- responsibleFor
properties:
responsibleFor:
oneOf:
- $ref: '#/components/schemas/Dog'
- $ref: '#/components/schemas/Cat'
CreateParkVisitorPerson:
type: object
allOf:
- $ref: '#/components/schemas/AbstractCreateParkPerson'
Dog:
type: object
allOf:
- $ref: '#/components/schemas/AbstractAnimal'

requestBodies:
Foo:
Expand All @@ -235,4 +303,4 @@ components:
schema:
type: array
items:
$ref: '#/components/schemas/FooRefOrValue'
$ref: '#/components/schemas/FooRefOrValue'
16 changes: 16 additions & 0 deletions samples/client/others/rust/hyper/oneOf/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.travis.yml
Cargo.toml
README.md
docs/AbstractAnimal.md
docs/AbstractCreateParkPerson.md
docs/Addressable.md
docs/Apple.md
docs/Banana.md
Expand All @@ -10,6 +12,11 @@ docs/BarApi.md
docs/BarCreate.md
docs/BarRef.md
docs/BarRefOrValue.md
docs/Cat.md
docs/CreateParkAnimalCarerPerson.md
docs/CreateParkPersonRequest.md
docs/CreateParkVisitorPerson.md
docs/Dog.md
docs/Entity.md
docs/EntityRef.md
docs/Extensible.md
Expand All @@ -20,6 +27,7 @@ docs/FooRefOrValue.md
docs/Fruit.md
docs/FruitType.md
docs/Pasta.md
docs/PerkPersonApi.md
docs/Pizza.md
docs/PizzaSpeziale.md
git_push.sh
Expand All @@ -28,15 +36,23 @@ src/apis/client.rs
src/apis/configuration.rs
src/apis/foo_api.rs
src/apis/mod.rs
src/apis/perk_person_api.rs
src/apis/request.rs
src/lib.rs
src/models/abstract_animal.rs
src/models/abstract_create_park_person.rs
src/models/addressable.rs
src/models/apple.rs
src/models/banana.rs
src/models/bar.rs
src/models/bar_create.rs
src/models/bar_ref.rs
src/models/bar_ref_or_value.rs
src/models/cat.rs
src/models/create_park_animal_carer_person.rs
src/models/create_park_person_request.rs
src/models/create_park_visitor_person.rs
src/models/dog.rs
src/models/entity.rs
src/models/entity_ref.rs
src/models/extensible.rs
Expand Down
8 changes: 8 additions & 0 deletions samples/client/others/rust/hyper/oneOf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,25 @@ Class | Method | HTTP request | Description
*BarApi* | [**create_bar**](docs/BarApi.md#create_bar) | **Post** /bar | Create a Bar
*FooApi* | [**create_foo**](docs/FooApi.md#create_foo) | **Post** /foo | Create a Foo
*FooApi* | [**get_all_foos**](docs/FooApi.md#get_all_foos) | **Get** /foo | GET all Foos
*PerkPersonApi* | [**create_park_person**](docs/PerkPersonApi.md#create_park_person) | **Post** /park-persons | Create a Park Person


## Documentation For Models

- [AbstractAnimal](docs/AbstractAnimal.md)
- [AbstractCreateParkPerson](docs/AbstractCreateParkPerson.md)
- [Addressable](docs/Addressable.md)
- [Apple](docs/Apple.md)
- [Banana](docs/Banana.md)
- [Bar](docs/Bar.md)
- [BarCreate](docs/BarCreate.md)
- [BarRef](docs/BarRef.md)
- [BarRefOrValue](docs/BarRefOrValue.md)
- [Cat](docs/Cat.md)
- [CreateParkAnimalCarerPerson](docs/CreateParkAnimalCarerPerson.md)
- [CreateParkPersonRequest](docs/CreateParkPersonRequest.md)
- [CreateParkVisitorPerson](docs/CreateParkVisitorPerson.md)
- [Dog](docs/Dog.md)
- [Entity](docs/Entity.md)
- [EntityRef](docs/EntityRef.md)
- [Extensible](docs/Extensible.md)
Expand Down
10 changes: 10 additions & 0 deletions samples/client/others/rust/hyper/oneOf/docs/AbstractAnimal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# AbstractAnimal

## Enum Variants

| Name | Value |
|---- | -----|

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# AbstractCreateParkPerson

## Enum Variants

| Name | Value |
|---- | -----|

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


11 changes: 11 additions & 0 deletions samples/client/others/rust/hyper/oneOf/docs/Cat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Cat

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**r#type** | **String** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# CreateParkAnimalCarerPerson

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**responsible_for** | Option<[**models::OneOfLessThanDogCommaCatGreaterThan**](oneOf<Dog,Cat>.md)> | |
**r#type** | **String** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# CreateParkPersonRequest

## Enum Variants

| Name | Description |
|---- | -----|
| CreateParkAnimalCarerPerson | |
| CreateParkVisitorPerson | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# CreateParkVisitorPerson

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**r#type** | **String** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


11 changes: 11 additions & 0 deletions samples/client/others/rust/hyper/oneOf/docs/Dog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Dog

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**r#type** | **String** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


37 changes: 37 additions & 0 deletions samples/client/others/rust/hyper/oneOf/docs/PerkPersonApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# \PerkPersonApi

All URIs are relative to *http://localhost:8080*

Method | HTTP request | Description
------------- | ------------- | -------------
[**create_park_person**](PerkPersonApi.md#create_park_person) | **Post** /park-persons | Create a Park Person



## create_park_person

> String create_park_person(create_park_person_request)
Create a Park Person

### Parameters


Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**create_park_person_request** | [**CreateParkPersonRequest**](CreateParkPersonRequest.md) | | [required] |

### Return type

**String**

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

6 changes: 6 additions & 0 deletions samples/client/others/rust/hyper/oneOf/src/apis/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use super::configuration::Configuration;
pub struct APIClient {
bar_api: Box<dyn crate::apis::BarApi>,
foo_api: Box<dyn crate::apis::FooApi>,
perk_person_api: Box<dyn crate::apis::PerkPersonApi>,
}

impl APIClient {
Expand All @@ -16,6 +17,7 @@ impl APIClient {
APIClient {
bar_api: Box::new(crate::apis::BarApiClient::new(rc.clone())),
foo_api: Box::new(crate::apis::FooApiClient::new(rc.clone())),
perk_person_api: Box::new(crate::apis::PerkPersonApiClient::new(rc.clone())),
}
}

Expand All @@ -27,4 +29,8 @@ impl APIClient {
self.foo_api.as_ref()
}

pub fn perk_person_api(&self) -> &dyn crate::apis::PerkPersonApi{
self.perk_person_api.as_ref()
}

}
2 changes: 2 additions & 0 deletions samples/client/others/rust/hyper/oneOf/src/apis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ mod bar_api;
pub use self::bar_api::{ BarApi, BarApiClient };
mod foo_api;
pub use self::foo_api::{ FooApi, FooApiClient };
mod perk_person_api;
pub use self::perk_person_api::{ PerkPersonApi, PerkPersonApiClient };

pub mod configuration;
pub mod client;
53 changes: 53 additions & 0 deletions samples/client/others/rust/hyper/oneOf/src/apis/perk_person_api.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* ByRefOrValue
*
* This tests for a oneOf interface representation
*
* The version of the OpenAPI document: 0.0.1
*
* Generated by: https://openapi-generator.tech
*/

use std::rc::Rc;
use std::borrow::Borrow;
use std::pin::Pin;
#[allow(unused_imports)]
use std::option::Option;

use hyper;
use futures::Future;

use crate::models;
use super::{Error, configuration};
use super::request as __internal_request;

pub struct PerkPersonApiClient<C: hyper::client::connect::Connect>
where C: Clone + std::marker::Send + Sync + 'static {
configuration: Rc<configuration::Configuration<C>>,
}

impl<C: hyper::client::connect::Connect> PerkPersonApiClient<C>
where C: Clone + std::marker::Send + Sync {
pub fn new(configuration: Rc<configuration::Configuration<C>>) -> PerkPersonApiClient<C> {
PerkPersonApiClient {
configuration,
}
}
}

pub trait PerkPersonApi {
fn create_park_person(&self, create_park_person_request: models::CreateParkPersonRequest) -> Pin<Box<dyn Future<Output = Result<String, Error>>>>;
}

impl<C: hyper::client::connect::Connect>PerkPersonApi for PerkPersonApiClient<C>
where C: Clone + std::marker::Send + Sync {
#[allow(unused_mut)]
fn create_park_person(&self, create_park_person_request: models::CreateParkPersonRequest) -> Pin<Box<dyn Future<Output = Result<String, Error>>>> {
let mut req = __internal_request::Request::new(hyper::Method::POST, "/park-persons".to_string())
;
req = req.with_body_param(create_park_person_request);

req.execute(self.configuration.borrow())
}

}
Loading

0 comments on commit 57117e6

Please sign in to comment.