From 0da60def01d520717ab33b8d707d4ad64c5cb3ee Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 26 Jun 2024 10:04:23 +0800 Subject: [PATCH] update samples --- .../others/rust/hyper/oneOf/docs/Bar.md | 8 +- .../others/rust/hyper/oneOf/docs/BarCreate.md | 6 +- .../others/rust/hyper/oneOf/docs/BarRef.md | 4 +- .../others/rust/hyper/oneOf/docs/Foo.md | 4 +- .../others/rust/hyper/oneOf/docs/FooRef.md | 6 +- .../others/rust/hyper/oneOf/docs/Pasta.md | 2 +- .../others/rust/hyper/oneOf/docs/Pizza.md | 2 +- .../rust/hyper/oneOf/docs/PizzaSpeziale.md | 4 +- .../others/rust/hyper/oneOf/src/models/bar.rs | 24 ++-- .../rust/hyper/oneOf/src/models/bar_create.rs | 18 +-- .../rust/hyper/oneOf/src/models/bar_ref.rs | 16 +-- .../rust/hyper/oneOf/src/models/entity_ref.rs | 23 ++-- .../others/rust/hyper/oneOf/src/models/foo.rs | 12 +- .../rust/hyper/oneOf/src/models/foo_ref.rs | 22 +-- .../rust/hyper/oneOf/src/models/pasta.rs | 6 +- .../rust/hyper/oneOf/src/models/pizza.rs | 6 +- .../hyper/oneOf/src/models/pizza_speziale.rs | 12 +- .../others/rust/reqwest/oneOf/docs/Bar.md | 8 +- .../rust/reqwest/oneOf/docs/BarCreate.md | 6 +- .../others/rust/reqwest/oneOf/docs/BarRef.md | 4 +- .../others/rust/reqwest/oneOf/docs/Foo.md | 4 +- .../others/rust/reqwest/oneOf/docs/FooRef.md | 6 +- .../others/rust/reqwest/oneOf/docs/Pasta.md | 2 +- .../others/rust/reqwest/oneOf/docs/Pizza.md | 2 +- .../rust/reqwest/oneOf/docs/PizzaSpeziale.md | 4 +- .../rust/reqwest/oneOf/src/models/bar.rs | 24 ++-- .../reqwest/oneOf/src/models/bar_create.rs | 18 +-- .../rust/reqwest/oneOf/src/models/bar_ref.rs | 16 +-- .../reqwest/oneOf/src/models/entity_ref.rs | 23 ++-- .../rust/reqwest/oneOf/src/models/foo.rs | 12 +- .../rust/reqwest/oneOf/src/models/foo_ref.rs | 22 +-- .../rust/reqwest/oneOf/src/models/pasta.rs | 6 +- .../rust/reqwest/oneOf/src/models/pizza.rs | 6 +- .../oneOf/src/models/pizza_speziale.rs | 12 +- .../generichost/net4.7/AllOf/api/openapi.yaml | 11 +- .../net4.7/AllOf/docs/models/Child.md | 1 - .../AllOf/src/Org.OpenAPITools/Model/Child.cs | 44 +++--- .../generichost/net4.8/AllOf/api/openapi.yaml | 11 +- .../net4.8/AllOf/docs/models/Child.md | 1 - .../AllOf/src/Org.OpenAPITools/Model/Child.cs | 44 +++--- .../generichost/net8/AllOf/api/openapi.yaml | 11 +- .../net8/AllOf/docs/models/Child.md | 1 - .../AllOf/src/Org.OpenAPITools/Model/Child.cs | 44 +++--- .../doc/Bar.md | 8 +- .../doc/BarCreate.md | 6 +- .../doc/BarRef.md | 4 +- .../doc/BarRefOrValue.md | 8 +- .../doc/EntityRef.md | 4 +- .../doc/Foo.md | 4 +- .../doc/FooRef.md | 6 +- .../doc/FooRefOrValue.md | 6 +- .../doc/Pasta.md | 2 +- .../doc/Pizza.md | 2 +- .../doc/PizzaSpeziale.md | 4 +- .../lib/src/model/bar.dart | 8 +- .../lib/src/model/bar_create.dart | 6 +- .../lib/src/model/bar_ref.dart | 4 +- .../lib/src/model/bar_ref_or_value.dart | 8 +- .../lib/src/model/entity_ref.dart | 6 +- .../lib/src/model/foo.dart | 4 +- .../lib/src/model/foo_ref.dart | 6 +- .../lib/src/model/foo_ref_or_value.dart | 6 +- .../lib/src/model/pasta.dart | 2 +- .../lib/src/model/pizza.dart | 2 +- .../lib/src/model/pizza_speziale.dart | 4 +- .../petstore/go/go-petstore/api/openapi.yaml | 71 +++++----- .../petstore/go/go-petstore/go/model_order.go | 10 +- .../java/org/openapitools/api/BarApi.java | 2 +- .../java/org/openapitools/api/FooApi.java | 4 +- .../java/org/openapitools/model/BarRef.java | 44 +++--- .../org/openapitools/model/EntityRef.java | 129 +++++++++--------- .../java/org/openapitools/model/FooRef.java | 44 +++--- .../src/main/resources/openapi.yaml | 122 +++++++++++------ .../petstore/go-api-server/api/openapi.yaml | 70 +++++----- .../petstore/go-api-server/go/model_order.go | 10 +- .../petstore/go-chi-server/api/openapi.yaml | 70 +++++----- .../petstore/go-chi-server/go/model_order.go | 10 +- .../output/rust-server-test/api/openapi.yaml | 9 +- .../rust-server-test/docs/AllOfObject.md | 2 +- .../output/rust-server-test/src/models.rs | 30 ++-- 80 files changed, 646 insertions(+), 609 deletions(-) diff --git a/samples/client/others/rust/hyper/oneOf/docs/Bar.md b/samples/client/others/rust/hyper/oneOf/docs/Bar.md index 188b551a0f92..605fc68fce3e 100644 --- a/samples/client/others/rust/hyper/oneOf/docs/Bar.md +++ b/samples/client/others/rust/hyper/oneOf/docs/Bar.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **String** | | -**bar_prop_a** | Option<**String**> | | [optional] -**foo_prop_b** | Option<**String**> | | [optional] -**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] +**id** | **String** | | **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**bar_prop_a** | Option<**String**> | | [optional] +**foo_prop_b** | Option<**String**> | | [optional] +**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/hyper/oneOf/docs/BarCreate.md b/samples/client/others/rust/hyper/oneOf/docs/BarCreate.md index f03857dc29b8..4fb0d42c7cbd 100644 --- a/samples/client/others/rust/hyper/oneOf/docs/BarCreate.md +++ b/samples/client/others/rust/hyper/oneOf/docs/BarCreate.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**bar_prop_a** | Option<**String**> | | [optional] -**foo_prop_b** | Option<**String**> | | [optional] -**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**bar_prop_a** | Option<**String**> | | [optional] +**foo_prop_b** | Option<**String**> | | [optional] +**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/hyper/oneOf/docs/BarRef.md b/samples/client/others/rust/hyper/oneOf/docs/BarRef.md index d06048b7bd41..a785dc57aacc 100644 --- a/samples/client/others/rust/hyper/oneOf/docs/BarRef.md +++ b/samples/client/others/rust/hyper/oneOf/docs/BarRef.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | Option<**String**> | Name of the related entity. | [optional] -**at_referred_type** | Option<**String**> | The actual type of the target instance when needed for disambiguation. | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**name** | Option<**String**> | Name of the related entity. | [optional] +**at_referred_type** | Option<**String**> | The actual type of the target instance when needed for disambiguation. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/hyper/oneOf/docs/Foo.md b/samples/client/others/rust/hyper/oneOf/docs/Foo.md index e9c477f6402c..330abd09799b 100644 --- a/samples/client/others/rust/hyper/oneOf/docs/Foo.md +++ b/samples/client/others/rust/hyper/oneOf/docs/Foo.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo_prop_a** | Option<**String**> | | [optional] -**foo_prop_b** | Option<**String**> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**foo_prop_a** | Option<**String**> | | [optional] +**foo_prop_b** | Option<**String**> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/hyper/oneOf/docs/FooRef.md b/samples/client/others/rust/hyper/oneOf/docs/FooRef.md index cdf8713add35..27e20258e078 100644 --- a/samples/client/others/rust/hyper/oneOf/docs/FooRef.md +++ b/samples/client/others/rust/hyper/oneOf/docs/FooRef.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**fooref_prop_a** | Option<**String**> | | [optional] -**name** | Option<**String**> | Name of the related entity. | [optional] -**at_referred_type** | Option<**String**> | The actual type of the target instance when needed for disambiguation. | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**name** | Option<**String**> | Name of the related entity. | [optional] +**at_referred_type** | Option<**String**> | The actual type of the target instance when needed for disambiguation. | [optional] +**fooref_prop_a** | Option<**String**> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/hyper/oneOf/docs/Pasta.md b/samples/client/others/rust/hyper/oneOf/docs/Pasta.md index 466f47710151..dc6afc170067 100644 --- a/samples/client/others/rust/hyper/oneOf/docs/Pasta.md +++ b/samples/client/others/rust/hyper/oneOf/docs/Pasta.md @@ -4,12 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**vendor** | Option<**String**> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**vendor** | Option<**String**> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/hyper/oneOf/docs/Pizza.md b/samples/client/others/rust/hyper/oneOf/docs/Pizza.md index 4e4638422e2d..dfba87813c1f 100644 --- a/samples/client/others/rust/hyper/oneOf/docs/Pizza.md +++ b/samples/client/others/rust/hyper/oneOf/docs/Pizza.md @@ -4,12 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pizza_size** | Option<**f64**> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**pizza_size** | Option<**f64**> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/hyper/oneOf/docs/PizzaSpeziale.md b/samples/client/others/rust/hyper/oneOf/docs/PizzaSpeziale.md index c02246e8e0db..79d3aceedfb2 100644 --- a/samples/client/others/rust/hyper/oneOf/docs/PizzaSpeziale.md +++ b/samples/client/others/rust/hyper/oneOf/docs/PizzaSpeziale.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**toppings** | Option<**String**> | | [optional] -**pizza_size** | Option<**f64**> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**pizza_size** | Option<**f64**> | | [optional] +**toppings** | Option<**String**> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar.rs index 2499fb3a586b..ed85518807f2 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar.rs @@ -13,17 +13,11 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Bar { - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "barPropA", skip_serializing_if = "Option::is_none")] - pub bar_prop_a: Option, - #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] - pub foo_prop_b: Option, - #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, + #[serde(rename = "id")] + pub id: String, /// A URI to a JSON-Schema file that defines additional attributes and relationships #[serde(rename = "@schemaLocation", skip_serializing_if = "Option::is_none")] pub at_schema_location: Option, @@ -33,19 +27,25 @@ pub struct Bar { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + #[serde(rename = "barPropA", skip_serializing_if = "Option::is_none")] + pub bar_prop_a: Option, + #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] + pub foo_prop_b: Option, + #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] + pub foo: Option>, } impl Bar { pub fn new(id: String, at_type: String) -> Bar { Bar { - id, - bar_prop_a: None, - foo_prop_b: None, - foo: None, href: None, + id, at_schema_location: None, at_base_type: None, at_type, + bar_prop_a: None, + foo_prop_b: None, + foo: None, } } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs index 6eb81b990336..98481c64e2f9 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar_create.rs @@ -13,12 +13,6 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct BarCreate { - #[serde(rename = "barPropA", skip_serializing_if = "Option::is_none")] - pub bar_prop_a: Option, - #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] - pub foo_prop_b: Option, - #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, @@ -34,19 +28,25 @@ pub struct BarCreate { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + #[serde(rename = "barPropA", skip_serializing_if = "Option::is_none")] + pub bar_prop_a: Option, + #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] + pub foo_prop_b: Option, + #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] + pub foo: Option>, } impl BarCreate { pub fn new(at_type: String) -> BarCreate { BarCreate { - bar_prop_a: None, - foo_prop_b: None, - foo: None, href: None, id: None, at_schema_location: None, at_base_type: None, at_type, + bar_prop_a: None, + foo_prop_b: None, + foo: None, } } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs index 8533dd933f57..ce4ee09caf9d 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/bar_ref.rs @@ -13,12 +13,6 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct BarRef { - /// Name of the related entity. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// The actual type of the target instance when needed for disambiguation. - #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")] - pub at_referred_type: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, @@ -34,18 +28,24 @@ pub struct BarRef { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + /// Name of the related entity. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// The actual type of the target instance when needed for disambiguation. + #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")] + pub at_referred_type: Option, } impl BarRef { pub fn new(at_type: String) -> BarRef { BarRef { - name: None, - at_referred_type: None, href: None, id: None, at_schema_location: None, at_base_type: None, at_type, + name: None, + at_referred_type: None, } } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs index 01272ef9fadb..d1a9853dc89b 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/entity_ref.rs @@ -11,18 +11,11 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// EntityRef : Entity reference schema to be use for all entityRef class. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] pub enum EntityRef { #[serde(rename="BarRef")] BarRef { - /// Name of the related entity. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - name: Option, - /// The actual type of the target instance when needed for disambiguation. - #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")] - at_referred_type: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] href: Option, @@ -35,15 +28,15 @@ pub enum EntityRef { /// When sub-classing, this defines the super-class #[serde(rename = "@baseType", skip_serializing_if = "Option::is_none")] at_base_type: Option, - }, - #[serde(rename="FooRef")] - FooRef { /// Name of the related entity. #[serde(rename = "name", skip_serializing_if = "Option::is_none")] name: Option, /// The actual type of the target instance when needed for disambiguation. #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")] at_referred_type: Option, + }, + #[serde(rename="FooRef")] + FooRef { /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] href: Option, @@ -56,18 +49,24 @@ pub enum EntityRef { /// When sub-classing, this defines the super-class #[serde(rename = "@baseType", skip_serializing_if = "Option::is_none")] at_base_type: Option, + /// Name of the related entity. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + name: Option, + /// The actual type of the target instance when needed for disambiguation. + #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")] + at_referred_type: Option, }, } impl Default for EntityRef { fn default() -> Self { Self::BarRef { - name: Default::default(), - at_referred_type: Default::default(), href: Default::default(), id: Default::default(), at_schema_location: Default::default(), at_base_type: Default::default(), + name: Default::default(), + at_referred_type: Default::default(), } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo.rs index ea618695d0bd..becc6957dd5d 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo.rs @@ -13,10 +13,6 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Foo { - #[serde(rename = "fooPropA", skip_serializing_if = "Option::is_none")] - pub foo_prop_a: Option, - #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] - pub foo_prop_b: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, @@ -32,18 +28,22 @@ pub struct Foo { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + #[serde(rename = "fooPropA", skip_serializing_if = "Option::is_none")] + pub foo_prop_a: Option, + #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] + pub foo_prop_b: Option, } impl Foo { pub fn new(at_type: String) -> Foo { Foo { - foo_prop_a: None, - foo_prop_b: None, href: None, id: None, at_schema_location: None, at_base_type: None, at_type, + foo_prop_a: None, + foo_prop_b: None, } } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs index d0b425044b75..f4b3a2837fb7 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/foo_ref.rs @@ -13,14 +13,6 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct FooRef { - #[serde(rename = "foorefPropA", skip_serializing_if = "Option::is_none")] - pub fooref_prop_a: Option, - /// Name of the related entity. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// The actual type of the target instance when needed for disambiguation. - #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")] - pub at_referred_type: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, @@ -36,19 +28,27 @@ pub struct FooRef { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + /// Name of the related entity. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// The actual type of the target instance when needed for disambiguation. + #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")] + pub at_referred_type: Option, + #[serde(rename = "foorefPropA", skip_serializing_if = "Option::is_none")] + pub fooref_prop_a: Option, } impl FooRef { pub fn new(at_type: String) -> FooRef { FooRef { - fooref_prop_a: None, - name: None, - at_referred_type: None, href: None, id: None, at_schema_location: None, at_base_type: None, at_type, + name: None, + at_referred_type: None, + fooref_prop_a: None, } } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs b/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs index 8ba2efce0838..5352c0da9d41 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/pasta.rs @@ -13,8 +13,6 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pasta { - #[serde(rename = "vendor", skip_serializing_if = "Option::is_none")] - pub vendor: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, @@ -30,17 +28,19 @@ pub struct Pasta { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + #[serde(rename = "vendor", skip_serializing_if = "Option::is_none")] + pub vendor: Option, } impl Pasta { pub fn new(at_type: String) -> Pasta { Pasta { - vendor: None, href: None, id: None, at_schema_location: None, at_base_type: None, at_type, + vendor: None, } } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs b/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs index bfe6de648264..b99e41a1a354 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/pizza.rs @@ -13,8 +13,6 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pizza { - #[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")] - pub pizza_size: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, @@ -30,17 +28,19 @@ pub struct Pizza { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + #[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")] + pub pizza_size: Option, } impl Pizza { pub fn new(at_type: String) -> Pizza { Pizza { - pizza_size: None, href: None, id: None, at_schema_location: None, at_base_type: None, at_type, + pizza_size: None, } } } diff --git a/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs b/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs index a294e07dfdbf..f3cfea721eff 100644 --- a/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs +++ b/samples/client/others/rust/hyper/oneOf/src/models/pizza_speziale.rs @@ -13,10 +13,6 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PizzaSpeziale { - #[serde(rename = "toppings", skip_serializing_if = "Option::is_none")] - pub toppings: Option, - #[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")] - pub pizza_size: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, @@ -32,18 +28,22 @@ pub struct PizzaSpeziale { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + #[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")] + pub pizza_size: Option, + #[serde(rename = "toppings", skip_serializing_if = "Option::is_none")] + pub toppings: Option, } impl PizzaSpeziale { pub fn new(at_type: String) -> PizzaSpeziale { PizzaSpeziale { - toppings: None, - pizza_size: None, href: None, id: None, at_schema_location: None, at_base_type: None, at_type, + pizza_size: None, + toppings: None, } } } diff --git a/samples/client/others/rust/reqwest/oneOf/docs/Bar.md b/samples/client/others/rust/reqwest/oneOf/docs/Bar.md index 188b551a0f92..605fc68fce3e 100644 --- a/samples/client/others/rust/reqwest/oneOf/docs/Bar.md +++ b/samples/client/others/rust/reqwest/oneOf/docs/Bar.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **String** | | -**bar_prop_a** | Option<**String**> | | [optional] -**foo_prop_b** | Option<**String**> | | [optional] -**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] +**id** | **String** | | **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**bar_prop_a** | Option<**String**> | | [optional] +**foo_prop_b** | Option<**String**> | | [optional] +**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/reqwest/oneOf/docs/BarCreate.md b/samples/client/others/rust/reqwest/oneOf/docs/BarCreate.md index f03857dc29b8..4fb0d42c7cbd 100644 --- a/samples/client/others/rust/reqwest/oneOf/docs/BarCreate.md +++ b/samples/client/others/rust/reqwest/oneOf/docs/BarCreate.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**bar_prop_a** | Option<**String**> | | [optional] -**foo_prop_b** | Option<**String**> | | [optional] -**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**bar_prop_a** | Option<**String**> | | [optional] +**foo_prop_b** | Option<**String**> | | [optional] +**foo** | Option<[**models::FooRefOrValue**](FooRefOrValue.md)> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/reqwest/oneOf/docs/BarRef.md b/samples/client/others/rust/reqwest/oneOf/docs/BarRef.md index d06048b7bd41..a785dc57aacc 100644 --- a/samples/client/others/rust/reqwest/oneOf/docs/BarRef.md +++ b/samples/client/others/rust/reqwest/oneOf/docs/BarRef.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | Option<**String**> | Name of the related entity. | [optional] -**at_referred_type** | Option<**String**> | The actual type of the target instance when needed for disambiguation. | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**name** | Option<**String**> | Name of the related entity. | [optional] +**at_referred_type** | Option<**String**> | The actual type of the target instance when needed for disambiguation. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/reqwest/oneOf/docs/Foo.md b/samples/client/others/rust/reqwest/oneOf/docs/Foo.md index e9c477f6402c..330abd09799b 100644 --- a/samples/client/others/rust/reqwest/oneOf/docs/Foo.md +++ b/samples/client/others/rust/reqwest/oneOf/docs/Foo.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foo_prop_a** | Option<**String**> | | [optional] -**foo_prop_b** | Option<**String**> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**foo_prop_a** | Option<**String**> | | [optional] +**foo_prop_b** | Option<**String**> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/reqwest/oneOf/docs/FooRef.md b/samples/client/others/rust/reqwest/oneOf/docs/FooRef.md index cdf8713add35..27e20258e078 100644 --- a/samples/client/others/rust/reqwest/oneOf/docs/FooRef.md +++ b/samples/client/others/rust/reqwest/oneOf/docs/FooRef.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**fooref_prop_a** | Option<**String**> | | [optional] -**name** | Option<**String**> | Name of the related entity. | [optional] -**at_referred_type** | Option<**String**> | The actual type of the target instance when needed for disambiguation. | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**name** | Option<**String**> | Name of the related entity. | [optional] +**at_referred_type** | Option<**String**> | The actual type of the target instance when needed for disambiguation. | [optional] +**fooref_prop_a** | Option<**String**> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/reqwest/oneOf/docs/Pasta.md b/samples/client/others/rust/reqwest/oneOf/docs/Pasta.md index 466f47710151..dc6afc170067 100644 --- a/samples/client/others/rust/reqwest/oneOf/docs/Pasta.md +++ b/samples/client/others/rust/reqwest/oneOf/docs/Pasta.md @@ -4,12 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**vendor** | Option<**String**> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**vendor** | Option<**String**> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/reqwest/oneOf/docs/Pizza.md b/samples/client/others/rust/reqwest/oneOf/docs/Pizza.md index 4e4638422e2d..dfba87813c1f 100644 --- a/samples/client/others/rust/reqwest/oneOf/docs/Pizza.md +++ b/samples/client/others/rust/reqwest/oneOf/docs/Pizza.md @@ -4,12 +4,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pizza_size** | Option<**f64**> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**pizza_size** | Option<**f64**> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/reqwest/oneOf/docs/PizzaSpeziale.md b/samples/client/others/rust/reqwest/oneOf/docs/PizzaSpeziale.md index c02246e8e0db..79d3aceedfb2 100644 --- a/samples/client/others/rust/reqwest/oneOf/docs/PizzaSpeziale.md +++ b/samples/client/others/rust/reqwest/oneOf/docs/PizzaSpeziale.md @@ -4,13 +4,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**toppings** | Option<**String**> | | [optional] -**pizza_size** | Option<**f64**> | | [optional] **href** | Option<**String**> | Hyperlink reference | [optional] **id** | Option<**String**> | unique identifier | [optional] **at_schema_location** | Option<**String**> | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **at_base_type** | Option<**String**> | When sub-classing, this defines the super-class | [optional] **at_type** | **String** | When sub-classing, this defines the sub-class Extensible name | +**pizza_size** | Option<**f64**> | | [optional] +**toppings** | Option<**String**> | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs index 2499fb3a586b..ed85518807f2 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar.rs @@ -13,17 +13,11 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Bar { - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "barPropA", skip_serializing_if = "Option::is_none")] - pub bar_prop_a: Option, - #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] - pub foo_prop_b: Option, - #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, + #[serde(rename = "id")] + pub id: String, /// A URI to a JSON-Schema file that defines additional attributes and relationships #[serde(rename = "@schemaLocation", skip_serializing_if = "Option::is_none")] pub at_schema_location: Option, @@ -33,19 +27,25 @@ pub struct Bar { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + #[serde(rename = "barPropA", skip_serializing_if = "Option::is_none")] + pub bar_prop_a: Option, + #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] + pub foo_prop_b: Option, + #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] + pub foo: Option>, } impl Bar { pub fn new(id: String, at_type: String) -> Bar { Bar { - id, - bar_prop_a: None, - foo_prop_b: None, - foo: None, href: None, + id, at_schema_location: None, at_base_type: None, at_type, + bar_prop_a: None, + foo_prop_b: None, + foo: None, } } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs index 6eb81b990336..98481c64e2f9 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar_create.rs @@ -13,12 +13,6 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct BarCreate { - #[serde(rename = "barPropA", skip_serializing_if = "Option::is_none")] - pub bar_prop_a: Option, - #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] - pub foo_prop_b: Option, - #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] - pub foo: Option>, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, @@ -34,19 +28,25 @@ pub struct BarCreate { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + #[serde(rename = "barPropA", skip_serializing_if = "Option::is_none")] + pub bar_prop_a: Option, + #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] + pub foo_prop_b: Option, + #[serde(rename = "foo", skip_serializing_if = "Option::is_none")] + pub foo: Option>, } impl BarCreate { pub fn new(at_type: String) -> BarCreate { BarCreate { - bar_prop_a: None, - foo_prop_b: None, - foo: None, href: None, id: None, at_schema_location: None, at_base_type: None, at_type, + bar_prop_a: None, + foo_prop_b: None, + foo: None, } } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs index 8533dd933f57..ce4ee09caf9d 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/bar_ref.rs @@ -13,12 +13,6 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct BarRef { - /// Name of the related entity. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// The actual type of the target instance when needed for disambiguation. - #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")] - pub at_referred_type: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, @@ -34,18 +28,24 @@ pub struct BarRef { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + /// Name of the related entity. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// The actual type of the target instance when needed for disambiguation. + #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")] + pub at_referred_type: Option, } impl BarRef { pub fn new(at_type: String) -> BarRef { BarRef { - name: None, - at_referred_type: None, href: None, id: None, at_schema_location: None, at_base_type: None, at_type, + name: None, + at_referred_type: None, } } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs index 01272ef9fadb..d1a9853dc89b 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/entity_ref.rs @@ -11,18 +11,11 @@ use crate::models; use serde::{Deserialize, Serialize}; -/// EntityRef : Entity reference schema to be use for all entityRef class. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "@type")] pub enum EntityRef { #[serde(rename="BarRef")] BarRef { - /// Name of the related entity. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - name: Option, - /// The actual type of the target instance when needed for disambiguation. - #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")] - at_referred_type: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] href: Option, @@ -35,15 +28,15 @@ pub enum EntityRef { /// When sub-classing, this defines the super-class #[serde(rename = "@baseType", skip_serializing_if = "Option::is_none")] at_base_type: Option, - }, - #[serde(rename="FooRef")] - FooRef { /// Name of the related entity. #[serde(rename = "name", skip_serializing_if = "Option::is_none")] name: Option, /// The actual type of the target instance when needed for disambiguation. #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")] at_referred_type: Option, + }, + #[serde(rename="FooRef")] + FooRef { /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] href: Option, @@ -56,18 +49,24 @@ pub enum EntityRef { /// When sub-classing, this defines the super-class #[serde(rename = "@baseType", skip_serializing_if = "Option::is_none")] at_base_type: Option, + /// Name of the related entity. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + name: Option, + /// The actual type of the target instance when needed for disambiguation. + #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")] + at_referred_type: Option, }, } impl Default for EntityRef { fn default() -> Self { Self::BarRef { - name: Default::default(), - at_referred_type: Default::default(), href: Default::default(), id: Default::default(), at_schema_location: Default::default(), at_base_type: Default::default(), + name: Default::default(), + at_referred_type: Default::default(), } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs index ea618695d0bd..becc6957dd5d 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo.rs @@ -13,10 +13,6 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Foo { - #[serde(rename = "fooPropA", skip_serializing_if = "Option::is_none")] - pub foo_prop_a: Option, - #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] - pub foo_prop_b: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, @@ -32,18 +28,22 @@ pub struct Foo { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + #[serde(rename = "fooPropA", skip_serializing_if = "Option::is_none")] + pub foo_prop_a: Option, + #[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")] + pub foo_prop_b: Option, } impl Foo { pub fn new(at_type: String) -> Foo { Foo { - foo_prop_a: None, - foo_prop_b: None, href: None, id: None, at_schema_location: None, at_base_type: None, at_type, + foo_prop_a: None, + foo_prop_b: None, } } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs index d0b425044b75..f4b3a2837fb7 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/foo_ref.rs @@ -13,14 +13,6 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct FooRef { - #[serde(rename = "foorefPropA", skip_serializing_if = "Option::is_none")] - pub fooref_prop_a: Option, - /// Name of the related entity. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// The actual type of the target instance when needed for disambiguation. - #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")] - pub at_referred_type: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, @@ -36,19 +28,27 @@ pub struct FooRef { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + /// Name of the related entity. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// The actual type of the target instance when needed for disambiguation. + #[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")] + pub at_referred_type: Option, + #[serde(rename = "foorefPropA", skip_serializing_if = "Option::is_none")] + pub fooref_prop_a: Option, } impl FooRef { pub fn new(at_type: String) -> FooRef { FooRef { - fooref_prop_a: None, - name: None, - at_referred_type: None, href: None, id: None, at_schema_location: None, at_base_type: None, at_type, + name: None, + at_referred_type: None, + fooref_prop_a: None, } } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs b/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs index 8ba2efce0838..5352c0da9d41 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/pasta.rs @@ -13,8 +13,6 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pasta { - #[serde(rename = "vendor", skip_serializing_if = "Option::is_none")] - pub vendor: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, @@ -30,17 +28,19 @@ pub struct Pasta { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + #[serde(rename = "vendor", skip_serializing_if = "Option::is_none")] + pub vendor: Option, } impl Pasta { pub fn new(at_type: String) -> Pasta { Pasta { - vendor: None, href: None, id: None, at_schema_location: None, at_base_type: None, at_type, + vendor: None, } } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs b/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs index bfe6de648264..b99e41a1a354 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/pizza.rs @@ -13,8 +13,6 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Pizza { - #[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")] - pub pizza_size: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, @@ -30,17 +28,19 @@ pub struct Pizza { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + #[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")] + pub pizza_size: Option, } impl Pizza { pub fn new(at_type: String) -> Pizza { Pizza { - pizza_size: None, href: None, id: None, at_schema_location: None, at_base_type: None, at_type, + pizza_size: None, } } } diff --git a/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs b/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs index a294e07dfdbf..f3cfea721eff 100644 --- a/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs +++ b/samples/client/others/rust/reqwest/oneOf/src/models/pizza_speziale.rs @@ -13,10 +13,6 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PizzaSpeziale { - #[serde(rename = "toppings", skip_serializing_if = "Option::is_none")] - pub toppings: Option, - #[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")] - pub pizza_size: Option, /// Hyperlink reference #[serde(rename = "href", skip_serializing_if = "Option::is_none")] pub href: Option, @@ -32,18 +28,22 @@ pub struct PizzaSpeziale { /// When sub-classing, this defines the sub-class Extensible name #[serde(rename = "@type")] pub at_type: String, + #[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")] + pub pizza_size: Option, + #[serde(rename = "toppings", skip_serializing_if = "Option::is_none")] + pub toppings: Option, } impl PizzaSpeziale { pub fn new(at_type: String) -> PizzaSpeziale { PizzaSpeziale { - toppings: None, - pizza_size: None, href: None, id: None, at_schema_location: None, at_base_type: None, at_type, + pizza_size: None, + toppings: None, } } } diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.7/AllOf/api/openapi.yaml index a6144ccdba8c..b0cf0d9af5ef 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/api/openapi.yaml @@ -64,8 +64,11 @@ components: type: integer type: object - $ref: '#/components/schemas/Person' - description: A representation of a child - properties: - boosterSeat: - type: boolean + - description: A representation of a child + properties: + boosterSeat: + type: boolean + type: object + example: null + example: null diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Child.md b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Child.md index bb2a1e5a5613..b242473ba034 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Child.md +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/docs/models/Child.md @@ -1,5 +1,4 @@ # Org.OpenAPITools.Model.Child -A representation of a child ## Properties diff --git a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs index 35adb6d48805..5d910cacf41e 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/AllOf/src/Org.OpenAPITools/Model/Child.cs @@ -25,7 +25,7 @@ namespace Org.OpenAPITools.Model { /// - /// A representation of a child + /// Child /// public partial class Child : Person, IValidatableObject { @@ -33,11 +33,11 @@ public partial class Child : Person, IValidatableObject /// Initializes a new instance of the class. /// /// age + /// boosterSeat /// firstName /// lastName - /// boosterSeat [JsonConstructor] - public Child(Option age = default, Option firstName = default, Option lastName = default, Option boosterSeat = default) : base(firstName, lastName) + public Child(Option age = default, Option boosterSeat = default, Option firstName = default, Option lastName = default) : base(firstName, lastName) { AgeOption = age; BoosterSeatOption = boosterSeat; @@ -59,13 +59,6 @@ public Child(Option age = default, Option firstName = default, Opt [JsonPropertyName("age")] public int? Age { get { return this.AgeOption; } set { this.AgeOption = new Option(value); } } - /// - /// The discriminator - /// - [JsonIgnore] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public new string Type { get; } = "Child"; - /// /// Used to track the state of BoosterSeat /// @@ -79,6 +72,13 @@ public Child(Option age = default, Option firstName = default, Opt [JsonPropertyName("boosterSeat")] public bool? BoosterSeat { get { return this.BoosterSeatOption; } set { this.BoosterSeatOption = new Option(value); } } + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string Type { get; } = "Child"; + /// /// Returns the string presentation of the object /// @@ -118,10 +118,10 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert JsonTokenType startingTokenType = utf8JsonReader.TokenType; Option age = default; + Option boosterSeat = default; Option firstName = default; Option lastName = default; Option type = default; - Option boosterSeat = default; while (utf8JsonReader.Read()) { @@ -142,6 +142,10 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert if (utf8JsonReader.TokenType != JsonTokenType.Null) age = new Option(utf8JsonReader.GetInt32()); break; + case "boosterSeat": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + boosterSeat = new Option(utf8JsonReader.GetBoolean()); + break; case "firstName": firstName = new Option(utf8JsonReader.GetString()); break; @@ -151,10 +155,6 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert case "$_type": type = new Option(utf8JsonReader.GetString()); break; - case "boosterSeat": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - boosterSeat = new Option(utf8JsonReader.GetBoolean()); - break; default: break; } @@ -164,6 +164,9 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert if (age.IsSet && age.Value == null) throw new ArgumentNullException(nameof(age), "Property is not nullable for class Child."); + if (boosterSeat.IsSet && boosterSeat.Value == null) + throw new ArgumentNullException(nameof(boosterSeat), "Property is not nullable for class Child."); + if (firstName.IsSet && firstName.Value == null) throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Child."); @@ -173,10 +176,7 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert if (type.IsSet && type.Value == null) throw new ArgumentNullException(nameof(type), "Property is not nullable for class Child."); - if (boosterSeat.IsSet && boosterSeat.Value == null) - throw new ArgumentNullException(nameof(boosterSeat), "Property is not nullable for class Child."); - - return new Child(age, firstName, lastName, boosterSeat); + return new Child(age, boosterSeat, firstName, lastName); } /// @@ -212,6 +212,9 @@ public void WriteProperties(Utf8JsonWriter writer, Child child, JsonSerializerOp if (child.AgeOption.IsSet) writer.WriteNumber("age", child.AgeOption.Value.Value); + if (child.BoosterSeatOption.IsSet) + writer.WriteBoolean("boosterSeat", child.BoosterSeatOption.Value.Value); + if (child.FirstNameOption.IsSet) writer.WriteString("firstName", child.FirstName); @@ -219,9 +222,6 @@ public void WriteProperties(Utf8JsonWriter writer, Child child, JsonSerializerOp writer.WriteString("lastName", child.LastName); writer.WriteString("$_type", child.Type); - - if (child.BoosterSeatOption.IsSet) - writer.WriteBoolean("boosterSeat", child.BoosterSeatOption.Value.Value); } } } diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.8/AllOf/api/openapi.yaml index a6144ccdba8c..b0cf0d9af5ef 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AllOf/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/api/openapi.yaml @@ -64,8 +64,11 @@ components: type: integer type: object - $ref: '#/components/schemas/Person' - description: A representation of a child - properties: - boosterSeat: - type: boolean + - description: A representation of a child + properties: + boosterSeat: + type: boolean + type: object + example: null + example: null diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/models/Child.md b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/models/Child.md index bb2a1e5a5613..b242473ba034 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/models/Child.md +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/docs/models/Child.md @@ -1,5 +1,4 @@ # Org.OpenAPITools.Model.Child -A representation of a child ## Properties diff --git a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Child.cs b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Child.cs index 35adb6d48805..5d910cacf41e 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Child.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/AllOf/src/Org.OpenAPITools/Model/Child.cs @@ -25,7 +25,7 @@ namespace Org.OpenAPITools.Model { /// - /// A representation of a child + /// Child /// public partial class Child : Person, IValidatableObject { @@ -33,11 +33,11 @@ public partial class Child : Person, IValidatableObject /// Initializes a new instance of the class. /// /// age + /// boosterSeat /// firstName /// lastName - /// boosterSeat [JsonConstructor] - public Child(Option age = default, Option firstName = default, Option lastName = default, Option boosterSeat = default) : base(firstName, lastName) + public Child(Option age = default, Option boosterSeat = default, Option firstName = default, Option lastName = default) : base(firstName, lastName) { AgeOption = age; BoosterSeatOption = boosterSeat; @@ -59,13 +59,6 @@ public Child(Option age = default, Option firstName = default, Opt [JsonPropertyName("age")] public int? Age { get { return this.AgeOption; } set { this.AgeOption = new Option(value); } } - /// - /// The discriminator - /// - [JsonIgnore] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public new string Type { get; } = "Child"; - /// /// Used to track the state of BoosterSeat /// @@ -79,6 +72,13 @@ public Child(Option age = default, Option firstName = default, Opt [JsonPropertyName("boosterSeat")] public bool? BoosterSeat { get { return this.BoosterSeatOption; } set { this.BoosterSeatOption = new Option(value); } } + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string Type { get; } = "Child"; + /// /// Returns the string presentation of the object /// @@ -118,10 +118,10 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert JsonTokenType startingTokenType = utf8JsonReader.TokenType; Option age = default; + Option boosterSeat = default; Option firstName = default; Option lastName = default; Option type = default; - Option boosterSeat = default; while (utf8JsonReader.Read()) { @@ -142,6 +142,10 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert if (utf8JsonReader.TokenType != JsonTokenType.Null) age = new Option(utf8JsonReader.GetInt32()); break; + case "boosterSeat": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + boosterSeat = new Option(utf8JsonReader.GetBoolean()); + break; case "firstName": firstName = new Option(utf8JsonReader.GetString()); break; @@ -151,10 +155,6 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert case "$_type": type = new Option(utf8JsonReader.GetString()); break; - case "boosterSeat": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - boosterSeat = new Option(utf8JsonReader.GetBoolean()); - break; default: break; } @@ -164,6 +164,9 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert if (age.IsSet && age.Value == null) throw new ArgumentNullException(nameof(age), "Property is not nullable for class Child."); + if (boosterSeat.IsSet && boosterSeat.Value == null) + throw new ArgumentNullException(nameof(boosterSeat), "Property is not nullable for class Child."); + if (firstName.IsSet && firstName.Value == null) throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Child."); @@ -173,10 +176,7 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert if (type.IsSet && type.Value == null) throw new ArgumentNullException(nameof(type), "Property is not nullable for class Child."); - if (boosterSeat.IsSet && boosterSeat.Value == null) - throw new ArgumentNullException(nameof(boosterSeat), "Property is not nullable for class Child."); - - return new Child(age, firstName, lastName, boosterSeat); + return new Child(age, boosterSeat, firstName, lastName); } /// @@ -212,6 +212,9 @@ public void WriteProperties(Utf8JsonWriter writer, Child child, JsonSerializerOp if (child.AgeOption.IsSet) writer.WriteNumber("age", child.AgeOption.Value.Value); + if (child.BoosterSeatOption.IsSet) + writer.WriteBoolean("boosterSeat", child.BoosterSeatOption.Value.Value); + if (child.FirstNameOption.IsSet) writer.WriteString("firstName", child.FirstName); @@ -219,9 +222,6 @@ public void WriteProperties(Utf8JsonWriter writer, Child child, JsonSerializerOp writer.WriteString("lastName", child.LastName); writer.WriteString("$_type", child.Type); - - if (child.BoosterSeatOption.IsSet) - writer.WriteBoolean("boosterSeat", child.BoosterSeatOption.Value.Value); } } } diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net8/AllOf/api/openapi.yaml index a6144ccdba8c..b0cf0d9af5ef 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/api/openapi.yaml @@ -64,8 +64,11 @@ components: type: integer type: object - $ref: '#/components/schemas/Person' - description: A representation of a child - properties: - boosterSeat: - type: boolean + - description: A representation of a child + properties: + boosterSeat: + type: boolean + type: object + example: null + example: null diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/docs/models/Child.md b/samples/client/petstore/csharp/generichost/net8/AllOf/docs/models/Child.md index bb2a1e5a5613..b242473ba034 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/docs/models/Child.md +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/docs/models/Child.md @@ -1,5 +1,4 @@ # Org.OpenAPITools.Model.Child -A representation of a child ## Properties diff --git a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Child.cs b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Child.cs index 426cf4706eee..e98fb38789fe 100644 --- a/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Child.cs +++ b/samples/client/petstore/csharp/generichost/net8/AllOf/src/Org.OpenAPITools/Model/Child.cs @@ -27,7 +27,7 @@ namespace Org.OpenAPITools.Model { /// - /// A representation of a child + /// Child /// public partial class Child : Person, IValidatableObject { @@ -35,11 +35,11 @@ public partial class Child : Person, IValidatableObject /// Initializes a new instance of the class. /// /// age + /// boosterSeat /// firstName /// lastName - /// boosterSeat [JsonConstructor] - public Child(Option age = default, Option firstName = default, Option lastName = default, Option boosterSeat = default) : base(firstName, lastName) + public Child(Option age = default, Option boosterSeat = default, Option firstName = default, Option lastName = default) : base(firstName, lastName) { AgeOption = age; BoosterSeatOption = boosterSeat; @@ -61,13 +61,6 @@ public Child(Option age = default, Option firstName = default, Op [JsonPropertyName("age")] public int? Age { get { return this.AgeOption; } set { this.AgeOption = new(value); } } - /// - /// The discriminator - /// - [JsonIgnore] - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public new string Type { get; } = "Child"; - /// /// Used to track the state of BoosterSeat /// @@ -81,6 +74,13 @@ public Child(Option age = default, Option firstName = default, Op [JsonPropertyName("boosterSeat")] public bool? BoosterSeat { get { return this.BoosterSeatOption; } set { this.BoosterSeatOption = new(value); } } + /// + /// The discriminator + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public new string Type { get; } = "Child"; + /// /// Returns the string presentation of the object /// @@ -120,10 +120,10 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert JsonTokenType startingTokenType = utf8JsonReader.TokenType; Option age = default; + Option boosterSeat = default; Option firstName = default; Option lastName = default; Option type = default; - Option boosterSeat = default; while (utf8JsonReader.Read()) { @@ -144,6 +144,10 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert if (utf8JsonReader.TokenType != JsonTokenType.Null) age = new Option(utf8JsonReader.GetInt32()); break; + case "boosterSeat": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + boosterSeat = new Option(utf8JsonReader.GetBoolean()); + break; case "firstName": firstName = new Option(utf8JsonReader.GetString()!); break; @@ -153,10 +157,6 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert case "$_type": type = new Option(utf8JsonReader.GetString()!); break; - case "boosterSeat": - if (utf8JsonReader.TokenType != JsonTokenType.Null) - boosterSeat = new Option(utf8JsonReader.GetBoolean()); - break; default: break; } @@ -166,6 +166,9 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert if (age.IsSet && age.Value == null) throw new ArgumentNullException(nameof(age), "Property is not nullable for class Child."); + if (boosterSeat.IsSet && boosterSeat.Value == null) + throw new ArgumentNullException(nameof(boosterSeat), "Property is not nullable for class Child."); + if (firstName.IsSet && firstName.Value == null) throw new ArgumentNullException(nameof(firstName), "Property is not nullable for class Child."); @@ -175,10 +178,7 @@ public override Child Read(ref Utf8JsonReader utf8JsonReader, Type typeToConvert if (type.IsSet && type.Value == null) throw new ArgumentNullException(nameof(type), "Property is not nullable for class Child."); - if (boosterSeat.IsSet && boosterSeat.Value == null) - throw new ArgumentNullException(nameof(boosterSeat), "Property is not nullable for class Child."); - - return new Child(age, firstName, lastName, boosterSeat); + return new Child(age, boosterSeat, firstName, lastName); } /// @@ -214,6 +214,9 @@ public void WriteProperties(Utf8JsonWriter writer, Child child, JsonSerializerOp if (child.AgeOption.IsSet) writer.WriteNumber("age", child.AgeOption.Value!.Value); + if (child.BoosterSeatOption.IsSet) + writer.WriteBoolean("boosterSeat", child.BoosterSeatOption.Value!.Value); + if (child.FirstNameOption.IsSet) writer.WriteString("firstName", child.FirstName); @@ -221,9 +224,6 @@ public void WriteProperties(Utf8JsonWriter writer, Child child, JsonSerializerOp writer.WriteString("lastName", child.LastName); writer.WriteString("$_type", child.Type); - - if (child.BoosterSeatOption.IsSet) - writer.WriteBoolean("boosterSeat", child.BoosterSeatOption.Value!.Value); } } } diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md index 4cccc863a489..3ee13ed88950 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Bar.md @@ -8,14 +8,14 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **String** | | -**barPropA** | **String** | | [optional] -**fooPropB** | **String** | | [optional] -**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] **href** | **String** | Hyperlink reference | [optional] +**id** | **String** | | **atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] **atType** | **String** | When sub-classing, this defines the sub-class Extensible name | +**barPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md index c0b4ba6edc9a..fb157787756c 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarCreate.md @@ -8,14 +8,14 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**barPropA** | **String** | | [optional] -**fooPropB** | **String** | | [optional] -**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] **href** | **String** | Hyperlink reference | [optional] **id** | **String** | unique identifier | [optional] **atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] **atType** | **String** | When sub-classing, this defines the sub-class Extensible name | +**barPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md index cab0e7e57386..d7591ffb7523 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRef.md @@ -8,13 +8,13 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **String** | Name of the related entity. | [optional] -**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] **href** | **String** | Hyperlink reference | [optional] **id** | **String** | unique identifier | [optional] **atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] **atType** | **String** | When sub-classing, this defines the sub-class Extensible name | +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md index f88727e11aa8..f1a1dfd35472 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/BarRefOrValue.md @@ -8,14 +8,14 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **String** | unique identifier | -**barPropA** | **String** | | [optional] -**fooPropB** | **String** | | [optional] -**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] **href** | **String** | Hyperlink reference | [optional] +**id** | **String** | unique identifier | **atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] **atType** | **String** | When sub-classing, this defines the sub-class Extensible name | +**barPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] +**foo** | [**FooRefOrValue**](FooRefOrValue.md) | | [optional] **name** | **String** | Name of the related entity. | [optional] **atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md index 80eae55f4145..c81731152512 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/EntityRef.md @@ -8,13 +8,13 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **String** | Name of the related entity. | [optional] -**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] **href** | **String** | Hyperlink reference | [optional] **id** | **String** | unique identifier | [optional] **atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] **atType** | **String** | When sub-classing, this defines the sub-class Extensible name | +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md index 2627691fefe5..10d99821d1d6 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Foo.md @@ -8,13 +8,13 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**fooPropA** | **String** | | [optional] -**fooPropB** | **String** | | [optional] **href** | **String** | Hyperlink reference | [optional] **id** | **String** | unique identifier | [optional] **atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] **atType** | **String** | When sub-classing, this defines the sub-class Extensible name | +**fooPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md index bfa62bd4f54b..611f20e78522 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRef.md @@ -8,14 +8,14 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**foorefPropA** | **String** | | [optional] -**name** | **String** | Name of the related entity. | [optional] -**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] **href** | **String** | Hyperlink reference | [optional] **id** | **String** | unique identifier | [optional] **atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] **atType** | **String** | When sub-classing, this defines the sub-class Extensible name | +**name** | **String** | Name of the related entity. | [optional] +**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] +**foorefPropA** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md index 9bc8dec10571..e9705b5cbeab 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/FooRefOrValue.md @@ -8,16 +8,16 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**fooPropA** | **String** | | [optional] -**fooPropB** | **String** | | [optional] **href** | **String** | Hyperlink reference | [optional] **id** | **String** | unique identifier | [optional] **atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] **atType** | **String** | When sub-classing, this defines the sub-class Extensible name | -**foorefPropA** | **String** | | [optional] +**fooPropA** | **String** | | [optional] +**fooPropB** | **String** | | [optional] **name** | **String** | Name of the related entity. | [optional] **atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] +**foorefPropA** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md index 034ff420d323..45d8633b2f75 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pasta.md @@ -8,12 +8,12 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**vendor** | **String** | | [optional] **href** | **String** | Hyperlink reference | [optional] **id** | **String** | unique identifier | [optional] **atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] **atType** | **String** | When sub-classing, this defines the sub-class Extensible name | +**vendor** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md index e4b040a6a79c..0b791f4e9813 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/Pizza.md @@ -8,12 +8,12 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pizzaSize** | **num** | | [optional] **href** | **String** | Hyperlink reference | [optional] **id** | **String** | unique identifier | [optional] **atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] **atType** | **String** | When sub-classing, this defines the sub-class Extensible name | +**pizzaSize** | **num** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md index 4e3800773dca..6d837c13ed55 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/doc/PizzaSpeziale.md @@ -8,13 +8,13 @@ import 'package:openapi/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**toppings** | **String** | | [optional] -**pizzaSize** | **num** | | [optional] **href** | **String** | Hyperlink reference | [optional] **id** | **String** | unique identifier | [optional] **atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] **atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] **atType** | **String** | When sub-classing, this defines the sub-class Extensible name | +**pizzaSize** | **num** | | [optional] +**toppings** | **String** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart index cb769550b4f2..b993c17d03b4 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar.dart @@ -13,14 +13,14 @@ part 'bar.g.dart'; /// Bar /// /// Properties: -/// * [id] -/// * [barPropA] -/// * [fooPropB] -/// * [foo] /// * [href] - Hyperlink reference +/// * [id] /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name +/// * [barPropA] +/// * [fooPropB] +/// * [foo] @BuiltValue() abstract class Bar implements Entity, Built { @BuiltValueField(wireName: r'foo') diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart index 8942b6433f5e..18e081045142 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_create.dart @@ -13,14 +13,14 @@ part 'bar_create.g.dart'; /// BarCreate /// /// Properties: -/// * [barPropA] -/// * [fooPropB] -/// * [foo] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name +/// * [barPropA] +/// * [fooPropB] +/// * [foo] @BuiltValue() abstract class BarCreate implements Entity, Built { @BuiltValueField(wireName: r'foo') diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart index 98f0724b35d2..84c1e4225d5c 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref.dart @@ -12,13 +12,13 @@ part 'bar_ref.g.dart'; /// BarRef /// /// Properties: -/// * [name] - Name of the related entity. -/// * [atReferredType] - The actual type of the target instance when needed for disambiguation. /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name +/// * [name] - Name of the related entity. +/// * [atReferredType] - The actual type of the target instance when needed for disambiguation. @BuiltValue() abstract class BarRef implements EntityRef, Built { BarRef._(); diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart index f880cb557955..31a5f74c8fd1 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/bar_ref_or_value.dart @@ -15,14 +15,14 @@ part 'bar_ref_or_value.g.dart'; /// BarRefOrValue /// /// Properties: -/// * [id] - unique identifier -/// * [barPropA] -/// * [fooPropB] -/// * [foo] /// * [href] - Hyperlink reference +/// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name +/// * [barPropA] +/// * [fooPropB] +/// * [foo] /// * [name] - Name of the related entity. /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. @BuiltValue() diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart index 7502c94dd7f3..91fdfd017d78 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/entity_ref.dart @@ -12,16 +12,16 @@ import 'package:built_value/serializer.dart'; part 'entity_ref.g.dart'; -/// Entity reference schema to be use for all entityRef class. +/// EntityRef /// /// Properties: -/// * [name] - Name of the related entity. -/// * [atReferredType] - The actual type of the target instance when needed for disambiguation. /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name +/// * [name] - Name of the related entity. +/// * [atReferredType] - The actual type of the target instance when needed for disambiguation. @BuiltValue(instantiable: false) abstract class EntityRef implements Addressable, Extensible { /// The actual type of the target instance when needed for disambiguation. diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart index d2e1f5817f20..d53271b23f6d 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo.dart @@ -12,13 +12,13 @@ part 'foo.g.dart'; /// Foo /// /// Properties: -/// * [fooPropA] -/// * [fooPropB] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name +/// * [fooPropA] +/// * [fooPropB] @BuiltValue() abstract class Foo implements Entity, Built { @BuiltValueField(wireName: r'fooPropA') diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart index 3f032ee8e08f..0821d3d6b2ba 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref.dart @@ -12,14 +12,14 @@ part 'foo_ref.g.dart'; /// FooRef /// /// Properties: -/// * [foorefPropA] -/// * [name] - Name of the related entity. -/// * [atReferredType] - The actual type of the target instance when needed for disambiguation. /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name +/// * [name] - Name of the related entity. +/// * [atReferredType] - The actual type of the target instance when needed for disambiguation. +/// * [foorefPropA] @BuiltValue() abstract class FooRef implements EntityRef, Built { @BuiltValueField(wireName: r'foorefPropA') diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart index d8164c5b9073..073fb4ff9c5e 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/foo_ref_or_value.dart @@ -14,16 +14,16 @@ part 'foo_ref_or_value.g.dart'; /// FooRefOrValue /// /// Properties: -/// * [fooPropA] -/// * [fooPropB] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name -/// * [foorefPropA] +/// * [fooPropA] +/// * [fooPropB] /// * [name] - Name of the related entity. /// * [atReferredType] - The actual type of the target instance when needed for disambiguation. +/// * [foorefPropA] @BuiltValue() abstract class FooRefOrValue implements Built { /// One Of [Foo], [FooRef] diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart index e8b1ebdf31ea..464138865122 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pasta.dart @@ -12,12 +12,12 @@ part 'pasta.g.dart'; /// Pasta /// /// Properties: -/// * [vendor] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name +/// * [vendor] @BuiltValue() abstract class Pasta implements Entity, Built { @BuiltValueField(wireName: r'vendor') diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart index 14c06db06d7e..6e255af0866f 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza.dart @@ -13,12 +13,12 @@ part 'pizza.g.dart'; /// Pizza /// /// Properties: -/// * [pizzaSize] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name +/// * [pizzaSize] @BuiltValue(instantiable: false) abstract class Pizza implements Entity { @BuiltValueField(wireName: r'pizzaSize') diff --git a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart index 73a2295df9ba..e7b0a05e729f 100644 --- a/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart +++ b/samples/openapi3/client/petstore/dart-dio/oneof_polymorphism_and_inheritance/lib/src/model/pizza_speziale.dart @@ -12,13 +12,13 @@ part 'pizza_speziale.g.dart'; /// PizzaSpeziale /// /// Properties: -/// * [toppings] -/// * [pizzaSize] /// * [href] - Hyperlink reference /// * [id] - unique identifier /// * [atSchemaLocation] - A URI to a JSON-Schema file that defines additional attributes and relationships /// * [atBaseType] - When sub-classing, this defines the super-class /// * [atType] - When sub-classing, this defines the sub-class Extensible name +/// * [pizzaSize] +/// * [toppings] @BuiltValue() abstract class PizzaSpeziale implements Pizza, Built { @BuiltValueField(wireName: r'toppings') diff --git a/samples/openapi3/server/petstore/go/go-petstore/api/openapi.yaml b/samples/openapi3/server/petstore/go/go-petstore/api/openapi.yaml index 0f32c07b9838..d9ccf02e3baa 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/server/petstore/go/go-petstore/api/openapi.yaml @@ -692,44 +692,49 @@ components: allOf: - $ref: '#/components/schemas/OrderInfo' - $ref: '#/components/schemas/SpecialInfo' - description: An order for a pets from the pet store + - description: An order for a pets from the pet store + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + comment: + nullable: true + type: string + required: + - comment + title: Pet Order + type: object + example: null example: - petId: 6 - quantity: 1 + petId: 5 + quantity: 5 + requireTest: requireTest comment: comment - id: 0 + id: 1 shipDate: 2000-01-23T04:56:07.000+00:00 + type: type complete: false + promotion: true status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - comment: - nullable: true - type: string - required: - - comment - title: Pet Order type: object xml: name: Order diff --git a/samples/openapi3/server/petstore/go/go-petstore/go/model_order.go b/samples/openapi3/server/petstore/go/go-petstore/go/model_order.go index 6680fe1d1927..f5a9b8f281be 100644 --- a/samples/openapi3/server/petstore/go/go-petstore/go/model_order.go +++ b/samples/openapi3/server/petstore/go/go-petstore/go/model_order.go @@ -17,11 +17,7 @@ import ( -// Order - An order for a pets from the pet store type Order struct { - SpecialInfo - - Id int64 `json:"id,omitempty"` PetId int64 `json:"petId,omitempty"` @@ -29,6 +25,8 @@ type Order struct { ShipDate time.Time `json:"shipDate,omitempty"` + Id int64 `json:"id,omitempty"` + // Order Status Status string `json:"status,omitempty"` @@ -49,10 +47,6 @@ func AssertOrderRequired(obj Order) error { } } - if err := AssertSpecialInfoRequired(obj.SpecialInfo); err != nil { - return err - } - return nil } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java index cee04a2da240..98e3f407b9b9 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java @@ -71,7 +71,7 @@ default ResponseEntity createBar( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"foo\" : { \"fooPropA\" : \"fooPropA\", \"fooPropB\" : \"fooPropB\" }, \"id\" : \"id\", \"fooPropB\" : \"fooPropB\", \"barPropA\" : \"barPropA\" }"; + String exampleString = "{ \"@baseType\" : \"@baseType\", \"@type\" : \"@type\", \"foo\" : { \"@baseType\" : \"@baseType\", \"@type\" : \"@type\", \"fooPropA\" : \"fooPropA\", \"href\" : \"href\", \"id\" : \"id\", \"fooPropB\" : \"fooPropB\", \"@schemaLocation\" : \"@schemaLocation\" }, \"href\" : \"href\", \"id\" : \"id\", \"fooPropB\" : \"fooPropB\", \"@schemaLocation\" : \"@schemaLocation\", \"barPropA\" : \"barPropA\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java index b7af0a2bfd20..c72b2c46f6d4 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java @@ -71,7 +71,7 @@ default ResponseEntity createFoo( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"fooPropA\" : \"fooPropA\", \"fooPropB\" : \"fooPropB\" }"; + String exampleString = "{ \"@baseType\" : \"@baseType\", \"@type\" : \"@type\", \"fooPropA\" : \"fooPropA\", \"href\" : \"href\", \"id\" : \"id\", \"fooPropB\" : \"fooPropB\", \"@schemaLocation\" : \"@schemaLocation\" }"; ApiUtil.setExampleResponse(request, "application/json", exampleString); break; } @@ -109,7 +109,7 @@ default ResponseEntity> getAllFoos( getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json;charset=utf-8"))) { - String exampleString = "[ { \"fooPropA\" : \"fooPropA\", \"fooPropB\" : \"fooPropB\" }, { \"fooPropA\" : \"fooPropA\", \"fooPropB\" : \"fooPropB\" } ]"; + String exampleString = "[ { \"@baseType\" : \"@baseType\", \"@type\" : \"@type\", \"fooPropA\" : \"fooPropA\", \"href\" : \"href\", \"id\" : \"id\", \"fooPropB\" : \"fooPropB\", \"@schemaLocation\" : \"@schemaLocation\" }, { \"@baseType\" : \"@baseType\", \"@type\" : \"@type\", \"fooPropA\" : \"fooPropA\", \"href\" : \"href\", \"id\" : \"id\", \"fooPropB\" : \"fooPropB\", \"@schemaLocation\" : \"@schemaLocation\" } ]"; ApiUtil.setExampleResponse(request, "application/json;charset=utf-8", exampleString); break; } diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarRef.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarRef.java index 1e06b28926c8..ca57fc2b20ff 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarRef.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarRef.java @@ -38,16 +38,6 @@ public BarRef(String atType) { } - public BarRef name(String name) { - super.name(name); - return this; - } - - public BarRef atReferredType(String atReferredType) { - super.atReferredType(atReferredType); - return this; - } - public BarRef href(String href) { super.href(href); return this; @@ -72,6 +62,16 @@ public BarRef atType(String atType) { super.atType(atType); return this; } + + public BarRef name(String name) { + super.name(name); + return this; + } + + public BarRef atReferredType(String atReferredType) { + super.atReferredType(atReferredType); + return this; + } @Override public boolean equals(Object o) { if (this == o) { @@ -126,18 +126,6 @@ protected Builder copyOf(BarRef value) { return this; } - @Override - public BarRef.Builder name(String name) { - this.instance.name(name); - return this; - } - - @Override - public BarRef.Builder atReferredType(String atReferredType) { - this.instance.atReferredType(atReferredType); - return this; - } - @Override public BarRef.Builder href(String href) { this.instance.href(href); @@ -168,6 +156,18 @@ public BarRef.Builder atType(String atType) { return this; } + @Override + public BarRef.Builder name(String name) { + this.instance.name(name); + return this; + } + + @Override + public BarRef.Builder atReferredType(String atReferredType) { + this.instance.atReferredType(atReferredType); + return this; + } + /** * returns a built BarRef instance. * diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java index 4a4cad51941b..6b4fc83de57d 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java @@ -18,10 +18,9 @@ import javax.annotation.Generated; /** - * Entity reference schema to be use for all entityRef class. + * EntityRef */ -@Schema(name = "EntityRef", description = "Entity reference schema to be use for all entityRef class.") @JsonIgnoreProperties( value = "@type", // ignore manually set @type, it will be automatically generated by Jackson during serialization allowSetters = true // allows the @type to be set during deserialization @@ -35,10 +34,6 @@ @Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.7.0-SNAPSHOT") public class EntityRef { - private String name; - - private String atReferredType; - private String href; private String id; @@ -49,6 +44,10 @@ public class EntityRef { private String atType; + private String name; + + private String atReferredType; + public EntityRef() { super(); } @@ -60,46 +59,6 @@ public EntityRef(String atType) { this.atType = atType; } - public EntityRef name(String name) { - this.name = name; - return this; - } - - /** - * Name of the related entity. - * @return name - */ - - @Schema(name = "name", description = "Name of the related entity.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("name") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public EntityRef atReferredType(String atReferredType) { - this.atReferredType = atReferredType; - return this; - } - - /** - * The actual type of the target instance when needed for disambiguation. - * @return atReferredType - */ - - @Schema(name = "@referredType", description = "The actual type of the target instance when needed for disambiguation.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("@referredType") - public String getAtReferredType() { - return atReferredType; - } - - public void setAtReferredType(String atReferredType) { - this.atReferredType = atReferredType; - } - public EntityRef href(String href) { this.href = href; return this; @@ -200,6 +159,46 @@ public void setAtType(String atType) { this.atType = atType; } + public EntityRef name(String name) { + this.name = name; + return this; + } + + /** + * Name of the related entity. + * @return name + */ + + @Schema(name = "name", description = "Name of the related entity.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public EntityRef atReferredType(String atReferredType) { + this.atReferredType = atReferredType; + return this; + } + + /** + * The actual type of the target instance when needed for disambiguation. + * @return atReferredType + */ + + @Schema(name = "@referredType", description = "The actual type of the target instance when needed for disambiguation.", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("@referredType") + public String getAtReferredType() { + return atReferredType; + } + + public void setAtReferredType(String atReferredType) { + this.atReferredType = atReferredType; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -209,31 +208,31 @@ public boolean equals(Object o) { return false; } EntityRef entityRef = (EntityRef) o; - return Objects.equals(this.name, entityRef.name) && - Objects.equals(this.atReferredType, entityRef.atReferredType) && - Objects.equals(this.href, entityRef.href) && + return Objects.equals(this.href, entityRef.href) && Objects.equals(this.id, entityRef.id) && Objects.equals(this.atSchemaLocation, entityRef.atSchemaLocation) && Objects.equals(this.atBaseType, entityRef.atBaseType) && - Objects.equals(this.atType, entityRef.atType); + Objects.equals(this.atType, entityRef.atType) && + Objects.equals(this.name, entityRef.name) && + Objects.equals(this.atReferredType, entityRef.atReferredType); } @Override public int hashCode() { - return Objects.hash(name, atReferredType, href, id, atSchemaLocation, atBaseType, atType); + return Objects.hash(href, id, atSchemaLocation, atBaseType, atType, name, atReferredType); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EntityRef {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" atReferredType: ").append(toIndentedString(atReferredType)).append("\n"); sb.append(" href: ").append(toIndentedString(href)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" atSchemaLocation: ").append(toIndentedString(atSchemaLocation)).append("\n"); sb.append(" atBaseType: ").append(toIndentedString(atBaseType)).append("\n"); sb.append(" atType: ").append(toIndentedString(atType)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" atReferredType: ").append(toIndentedString(atReferredType)).append("\n"); sb.append("}"); return sb.toString(); } @@ -262,26 +261,16 @@ protected Builder(EntityRef instance) { } protected Builder copyOf(EntityRef value) { - this.instance.setName(value.name); - this.instance.setAtReferredType(value.atReferredType); this.instance.setHref(value.href); this.instance.setId(value.id); this.instance.setAtSchemaLocation(value.atSchemaLocation); this.instance.setAtBaseType(value.atBaseType); this.instance.setAtType(value.atType); + this.instance.setName(value.name); + this.instance.setAtReferredType(value.atReferredType); return this; } - public EntityRef.Builder name(String name) { - this.instance.name(name); - return this; - } - - public EntityRef.Builder atReferredType(String atReferredType) { - this.instance.atReferredType(atReferredType); - return this; - } - public EntityRef.Builder href(String href) { this.instance.href(href); return this; @@ -307,6 +296,16 @@ public EntityRef.Builder atType(String atType) { return this; } + public EntityRef.Builder name(String name) { + this.instance.name(name); + return this; + } + + public EntityRef.Builder atReferredType(String atReferredType) { + this.instance.atReferredType(atReferredType); + return this; + } + /** * returns a built EntityRef instance. * diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java index a554c25cc150..95876b5fdddd 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java @@ -60,16 +60,6 @@ public void setFoorefPropA(String foorefPropA) { } - public FooRef name(String name) { - super.name(name); - return this; - } - - public FooRef atReferredType(String atReferredType) { - super.atReferredType(atReferredType); - return this; - } - public FooRef href(String href) { super.href(href); return this; @@ -94,6 +84,16 @@ public FooRef atType(String atType) { super.atType(atType); return this; } + + public FooRef name(String name) { + super.name(name); + return this; + } + + public FooRef atReferredType(String atReferredType) { + super.atReferredType(atReferredType); + return this; + } @Override public boolean equals(Object o) { if (this == o) { @@ -157,18 +157,6 @@ public FooRef.Builder foorefPropA(String foorefPropA) { return this; } - @Override - public FooRef.Builder name(String name) { - this.instance.name(name); - return this; - } - - @Override - public FooRef.Builder atReferredType(String atReferredType) { - this.instance.atReferredType(atReferredType); - return this; - } - @Override public FooRef.Builder href(String href) { this.instance.href(href); @@ -199,6 +187,18 @@ public FooRef.Builder atType(String atType) { return this; } + @Override + public FooRef.Builder name(String name) { + this.instance.name(name); + return this; + } + + @Override + public FooRef.Builder atReferredType(String atReferredType) { + this.instance.atReferredType(atReferredType); + return this; + } + /** * returns a built FooRef instance. * diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/resources/openapi.yaml index 50a9730c4e73..b4d07b04aa87 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/resources/openapi.yaml @@ -135,17 +135,20 @@ components: allOf: - $ref: '#/components/schemas/Addressable' - $ref: '#/components/schemas/Extensible' - description: Entity reference schema to be use for all entityRef class. + - description: Entity reference schema to be use for all entityRef class. + properties: + name: + description: Name of the related entity. + type: string + '@referredType': + description: The actual type of the target instance when needed for disambiguation. + type: string + type: object + example: null discriminator: propertyName: '@type' - properties: - name: - description: Name of the related entity. - type: string - '@referredType': - description: The actual type of the target instance when needed for disambiguation. - type: string type: object + example: null FooRefOrValue: discriminator: propertyName: '@type' @@ -157,22 +160,32 @@ components: Foo: allOf: - $ref: '#/components/schemas/Entity' + - properties: + fooPropA: + type: string + fooPropB: + type: string + type: object + example: null example: + '@baseType': '@baseType' + '@type': '@type' fooPropA: fooPropA + href: href + id: id fooPropB: fooPropB - properties: - fooPropA: - type: string - fooPropB: - type: string + '@schemaLocation': '@schemaLocation' type: object FooRef: allOf: - $ref: '#/components/schemas/EntityRef' - properties: - foorefPropA: - type: string + - properties: + foorefPropA: + type: string + type: object + example: null type: object + example: null BarRef: allOf: - $ref: '#/components/schemas/EntityRef' @@ -180,35 +193,49 @@ components: Bar_Create: allOf: - $ref: '#/components/schemas/Entity' - properties: - barPropA: - type: string - fooPropB: - type: string - foo: - $ref: '#/components/schemas/FooRefOrValue' + - properties: + barPropA: + type: string + fooPropB: + type: string + foo: + $ref: '#/components/schemas/FooRefOrValue' + type: object + example: null type: object + example: null Bar: allOf: - $ref: '#/components/schemas/Entity' + - properties: + id: + type: string + barPropA: + type: string + fooPropB: + type: string + foo: + $ref: '#/components/schemas/FooRefOrValue' + required: + - id + type: object + example: null example: + '@baseType': '@baseType' + '@type': '@type' foo: + '@baseType': '@baseType' + '@type': '@type' fooPropA: fooPropA + href: href + id: id fooPropB: fooPropB + '@schemaLocation': '@schemaLocation' + href: href id: id fooPropB: fooPropB + '@schemaLocation': '@schemaLocation' barPropA: barPropA - properties: - id: - type: string - barPropA: - type: string - fooPropB: - type: string - foo: - $ref: '#/components/schemas/FooRefOrValue' - required: - - id type: object BarRefOrValue: oneOf: @@ -219,24 +246,33 @@ components: Pizza: allOf: - $ref: '#/components/schemas/Entity' - properties: - pizzaSize: - type: number + - properties: + pizzaSize: + type: number + type: object + example: null type: object + example: null Pasta: allOf: - $ref: '#/components/schemas/Entity' - properties: - vendor: - type: string + - properties: + vendor: + type: string + type: object + example: null type: object + example: null PizzaSpeziale: allOf: - $ref: '#/components/schemas/Pizza' - properties: - toppings: - type: string + - properties: + toppings: + type: string + type: object + example: null type: object + example: null FruitType: enum: - APPLE diff --git a/samples/server/petstore/go-api-server/api/openapi.yaml b/samples/server/petstore/go-api-server/api/openapi.yaml index f309214557fe..0e50f3e9098e 100644 --- a/samples/server/petstore/go-api-server/api/openapi.yaml +++ b/samples/server/petstore/go-api-server/api/openapi.yaml @@ -948,44 +948,48 @@ components: allOf: - $ref: '#/components/schemas/OrderInfo' - $ref: '#/components/schemas/SpecialInfo' - description: An order for a pets from the pet store + - description: An order for a pets from the pet store + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + comment: + nullable: true + type: string + required: + - comment + title: Pet Order + type: object + example: null example: - petId: 6 - quantity: 1 + petId: 5 + quantity: 5 comment: comment - id: 0 + id: 1 shipDate: 2000-01-23T04:56:07.000+00:00 + type: type complete: false + promotion: true status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - comment: - nullable: true - type: string - required: - - comment - title: Pet Order type: object xml: name: Order diff --git a/samples/server/petstore/go-api-server/go/model_order.go b/samples/server/petstore/go-api-server/go/model_order.go index 7e66f8115a7e..50e934993586 100644 --- a/samples/server/petstore/go-api-server/go/model_order.go +++ b/samples/server/petstore/go-api-server/go/model_order.go @@ -17,11 +17,7 @@ import ( -// Order - An order for a pets from the pet store type Order struct { - SpecialInfo - - Id int64 `json:"id,omitempty"` PetId int64 `json:"petId,omitempty"` @@ -29,6 +25,8 @@ type Order struct { ShipDate time.Time `json:"shipDate,omitempty"` + Id int64 `json:"id,omitempty"` + // Order Status Status string `json:"status,omitempty"` @@ -48,10 +46,6 @@ func AssertOrderRequired(obj Order) error { } } - if err := AssertSpecialInfoRequired(obj.SpecialInfo); err != nil { - return err - } - return nil } diff --git a/samples/server/petstore/go-chi-server/api/openapi.yaml b/samples/server/petstore/go-chi-server/api/openapi.yaml index f309214557fe..0e50f3e9098e 100644 --- a/samples/server/petstore/go-chi-server/api/openapi.yaml +++ b/samples/server/petstore/go-chi-server/api/openapi.yaml @@ -948,44 +948,48 @@ components: allOf: - $ref: '#/components/schemas/OrderInfo' - $ref: '#/components/schemas/SpecialInfo' - description: An order for a pets from the pet store + - description: An order for a pets from the pet store + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + comment: + nullable: true + type: string + required: + - comment + title: Pet Order + type: object + example: null example: - petId: 6 - quantity: 1 + petId: 5 + quantity: 5 comment: comment - id: 0 + id: 1 shipDate: 2000-01-23T04:56:07.000+00:00 + type: type complete: false + promotion: true status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - comment: - nullable: true - type: string - required: - - comment - title: Pet Order type: object xml: name: Order diff --git a/samples/server/petstore/go-chi-server/go/model_order.go b/samples/server/petstore/go-chi-server/go/model_order.go index 7e66f8115a7e..50e934993586 100644 --- a/samples/server/petstore/go-chi-server/go/model_order.go +++ b/samples/server/petstore/go-chi-server/go/model_order.go @@ -17,11 +17,7 @@ import ( -// Order - An order for a pets from the pet store type Order struct { - SpecialInfo - - Id int64 `json:"id,omitempty"` PetId int64 `json:"petId,omitempty"` @@ -29,6 +25,8 @@ type Order struct { ShipDate time.Time `json:"shipDate,omitempty"` + Id int64 `json:"id,omitempty"` + // Order Status Status string `json:"status,omitempty"` @@ -48,10 +46,6 @@ func AssertOrderRequired(obj Order) error { } } - if err := AssertSpecialInfoRequired(obj.SpecialInfo); err != nil { - return err - } - return nil } diff --git a/samples/server/petstore/rust-server/output/rust-server-test/api/openapi.yaml b/samples/server/petstore/rust-server/output/rust-server-test/api/openapi.yaml index fcec6c8fa8b9..c63eb192b9c7 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/api/openapi.yaml +++ b/samples/server/petstore/rust-server/output/rust-server-test/api/openapi.yaml @@ -146,11 +146,14 @@ components: allOfObject: allOf: - $ref: '#/components/schemas/baseAllOf' + - properties: + sampleProperty: + type: string + type: object + example: null example: sampleProperty: sampleProperty - properties: - sampleProperty: - type: string + sampleBaseProperty: sampleBaseProperty baseAllOf: properties: sampleBaseProperty: diff --git a/samples/server/petstore/rust-server/output/rust-server-test/docs/AllOfObject.md b/samples/server/petstore/rust-server/output/rust-server-test/docs/AllOfObject.md index d9f96cbbc22e..e3b646a70e03 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/docs/AllOfObject.md +++ b/samples/server/petstore/rust-server/output/rust-server-test/docs/AllOfObject.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sample_property** | **String** | | [optional] [default to None] **sample_base_property** | **String** | | [optional] [default to None] +**sample_property** | **String** | | [optional] [default to None] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs index 0915bf515e28..f7af4d15dfb4 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs @@ -196,14 +196,14 @@ impl ::std::str::FromStr for AdditionalPropertiesObject { #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize, validator::Validate)] #[cfg_attr(feature = "conversion", derive(frunk::LabelledGeneric))] pub struct AllOfObject { - #[serde(rename = "sampleProperty")] - #[serde(skip_serializing_if="Option::is_none")] - pub sample_property: Option, - #[serde(rename = "sampleBaseProperty")] #[serde(skip_serializing_if="Option::is_none")] pub sample_base_property: Option, + #[serde(rename = "sampleProperty")] + #[serde(skip_serializing_if="Option::is_none")] + pub sample_property: Option, + } @@ -211,8 +211,8 @@ impl AllOfObject { #[allow(clippy::new_without_default)] pub fn new() -> AllOfObject { AllOfObject { - sample_property: None, sample_base_property: None, + sample_property: None, } } } @@ -224,18 +224,18 @@ impl std::string::ToString for AllOfObject { fn to_string(&self) -> String { let params: Vec> = vec![ - self.sample_property.as_ref().map(|sample_property| { + self.sample_base_property.as_ref().map(|sample_base_property| { [ - "sampleProperty".to_string(), - sample_property.to_string(), + "sampleBaseProperty".to_string(), + sample_base_property.to_string(), ].join(",") }), - self.sample_base_property.as_ref().map(|sample_base_property| { + self.sample_property.as_ref().map(|sample_property| { [ - "sampleBaseProperty".to_string(), - sample_base_property.to_string(), + "sampleProperty".to_string(), + sample_property.to_string(), ].join(",") }), @@ -256,8 +256,8 @@ impl std::str::FromStr for AllOfObject { #[derive(Default)] #[allow(dead_code)] struct IntermediateRep { - pub sample_property: Vec, pub sample_base_property: Vec, + pub sample_property: Vec, } let mut intermediate_rep = IntermediateRep::default(); @@ -275,10 +275,10 @@ impl std::str::FromStr for AllOfObject { if let Some(key) = key_result { #[allow(clippy::match_single_binding)] match key { - #[allow(clippy::redundant_clone)] - "sampleProperty" => intermediate_rep.sample_property.push(::from_str(val).map_err(|x| x.to_string())?), #[allow(clippy::redundant_clone)] "sampleBaseProperty" => intermediate_rep.sample_base_property.push(::from_str(val).map_err(|x| x.to_string())?), + #[allow(clippy::redundant_clone)] + "sampleProperty" => intermediate_rep.sample_property.push(::from_str(val).map_err(|x| x.to_string())?), _ => return std::result::Result::Err("Unexpected key while parsing AllOfObject".to_string()) } } @@ -289,8 +289,8 @@ impl std::str::FromStr for AllOfObject { // Use the intermediate representation to return the struct std::result::Result::Ok(AllOfObject { - sample_property: intermediate_rep.sample_property.into_iter().next(), sample_base_property: intermediate_rep.sample_base_property.into_iter().next(), + sample_property: intermediate_rep.sample_property.into_iter().next(), }) } }