Skip to content

Commit e0977a3

Browse files
committed
chore: Updated samples
1 parent 0d0a3d0 commit e0977a3

93 files changed

Lines changed: 1583 additions & 4 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/openapi-generator/src/test/resources/3_0/rust/petstore.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,3 +1107,16 @@ components:
11071107
allOf:
11081108
- $ref: '#/components/schemas/existing_tags_array'
11091109
- description: This is a test for allOf with metadata only fields
1110+
DuplicateOneOf:
1111+
type: object
1112+
oneOf:
1113+
- $ref: '#/components/schemas/Order'
1114+
- $ref: '#/components/schemas/Order'
1115+
WithInnerOneOf:
1116+
type: object
1117+
properties:
1118+
foo:
1119+
type: object
1120+
oneOf:
1121+
- $ref: '#/components/schemas/Order'
1122+
- $ref: '#/components/schemas/Order'

samples/client/others/rust/hyper/oneOf-reuseRef/src/models/fruit.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ use serde::{Deserialize, Serialize};
1616
pub enum Fruit {
1717
#[serde(rename="green_apple")]
1818
GreenApple(Box<models::Apple>),
19-
#[serde(rename="red_apple")]
20-
RedApple(Box<models::Apple>),
2119
#[serde(rename="banana")]
2220
Banana(Box<models::Banana>),
2321
}

samples/client/others/rust/reqwest/oneOf-reuseRef/src/models/fruit.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ use serde::{Deserialize, Serialize};
1616
pub enum Fruit {
1717
#[serde(rename="green_apple")]
1818
GreenApple(Box<models::Apple>),
19-
#[serde(rename="red_apple")]
20-
RedApple(Box<models::Apple>),
2119
#[serde(rename="banana")]
2220
Banana(Box<models::Banana>),
2321
}

samples/client/petstore/rust/hyper/petstore/.openapi-generator/FILES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ docs/ApiResponse.md
88
docs/ArrayItemRefTest.md
99
docs/Baz.md
1010
docs/Category.md
11+
docs/DuplicateOneOf.md
1112
docs/DuplicateTest.md
1213
docs/Duplicatetest.md
1314
docs/EnumArrayTesting.md
@@ -32,6 +33,8 @@ docs/UniqueItemArrayTesting.md
3233
docs/User.md
3334
docs/UserApi.md
3435
docs/Vehicle.md
36+
docs/WithInnerOneOf.md
37+
docs/WithInnerOneOfFoo.md
3538
git_push.sh
3639
src/apis/client.rs
3740
src/apis/configuration.rs
@@ -50,6 +53,7 @@ src/models/api_response.rs
5053
src/models/array_item_ref_test.rs
5154
src/models/baz.rs
5255
src/models/category.rs
56+
src/models/duplicate_one_of.rs
5357
src/models/duplicate_test.rs
5458
src/models/duplicatetest.rs
5559
src/models/enum_array_testing.rs
@@ -69,3 +73,5 @@ src/models/type_testing.rs
6973
src/models/unique_item_array_testing.rs
7074
src/models/user.rs
7175
src/models/vehicle.rs
76+
src/models/with_inner_one_of.rs
77+
src/models/with_inner_one_of_foo.rs

samples/client/petstore/rust/hyper/petstore/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Class | Method | HTTP request | Description
6161
- [ArrayItemRefTest](docs/ArrayItemRefTest.md)
6262
- [Baz](docs/Baz.md)
6363
- [Category](docs/Category.md)
64+
- [DuplicateOneOf](docs/DuplicateOneOf.md)
6465
- [DuplicateTest](docs/DuplicateTest.md)
6566
- [Duplicatetest](docs/Duplicatetest.md)
6667
- [EnumArrayTesting](docs/EnumArrayTesting.md)
@@ -80,6 +81,8 @@ Class | Method | HTTP request | Description
8081
- [UniqueItemArrayTesting](docs/UniqueItemArrayTesting.md)
8182
- [User](docs/User.md)
8283
- [Vehicle](docs/Vehicle.md)
84+
- [WithInnerOneOf](docs/WithInnerOneOf.md)
85+
- [WithInnerOneOfFoo](docs/WithInnerOneOfFoo.md)
8386

8487

8588
To get access to the crate's generated documentation, use:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# DuplicateOneOf
2+
3+
## Enum Variants
4+
5+
| Name | Description |
6+
|---- | -----|
7+
| Order | |
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# WithInnerOneOf
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**foo** | Option<[**models::WithInnerOneOfFoo**](WithInnerOneOf_foo.md)> | | [optional]
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# WithInnerOneOfFoo
2+
3+
## Enum Variants
4+
5+
| Name | Description |
6+
|---- | -----|
7+
| Order | |
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* OpenAPI Petstore
3+
*
4+
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
5+
*
6+
* The version of the OpenAPI document: 1.0.0
7+
*
8+
* Generated by: https://openapi-generator.tech
9+
*/
10+
11+
use crate::models;
12+
use serde::{Deserialize, Serialize};
13+
14+
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
15+
#[serde(untagged)]
16+
pub enum DuplicateOneOf {
17+
Order(Box<models::Order>),
18+
}
19+
20+
impl Default for DuplicateOneOf {
21+
fn default() -> Self {
22+
Self::Order(Default::default())
23+
}
24+
}
25+
/// Order Status
26+
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
27+
pub enum Status {
28+
#[serde(rename = "placed")]
29+
Placed,
30+
#[serde(rename = "approved")]
31+
Approved,
32+
#[serde(rename = "delivered")]
33+
Delivered,
34+
}
35+
36+
impl Default for Status {
37+
fn default() -> Status {
38+
Self::Placed
39+
}
40+
}
41+

samples/client/petstore/rust/hyper/petstore/src/models/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ pub mod baz;
1010
pub use self::baz::Baz;
1111
pub mod category;
1212
pub use self::category::Category;
13+
pub mod duplicate_one_of;
14+
pub use self::duplicate_one_of::DuplicateOneOf;
1315
pub mod duplicate_test;
1416
pub use self::duplicate_test::DuplicateTest;
1517
pub mod duplicatetest;
@@ -48,6 +50,10 @@ pub mod user;
4850
pub use self::user::User;
4951
pub mod vehicle;
5052
pub use self::vehicle::Vehicle;
53+
pub mod with_inner_one_of;
54+
pub use self::with_inner_one_of::WithInnerOneOf;
55+
pub mod with_inner_one_of_foo;
56+
pub use self::with_inner_one_of_foo::WithInnerOneOfFoo;
5157
use serde::{Deserialize, Deserializer, Serializer};
5258
use serde_with::{de::DeserializeAsWrap, ser::SerializeAsWrap, DeserializeAs, SerializeAs};
5359
use std::marker::PhantomData;

0 commit comments

Comments
 (0)