Compare commits

...

6 Commits

Author SHA1 Message Date
William Cheng
21872b47b1 update doc 2024-06-26 10:05:19 +08:00
William Cheng
0da60def01 update samples 2024-06-26 10:04:23 +08:00
William Cheng
7dac40e31c update comment 2024-06-26 09:55:31 +08:00
William Cheng
81feb4ba78 Merge remote-tracking branch 'origin/master' into normalizer-rule-default 2024-06-26 09:54:38 +08:00
William Cheng
1f9373eb4d update test 2024-03-27 12:27:39 +08:00
William Cheng
f06204b5ca set REFACTOR_ALLOF_WITH_PROPERTIES_ONLY to true by default 2024-03-27 11:58:06 +08:00
83 changed files with 660 additions and 618 deletions

View File

@ -512,6 +512,7 @@ OpenAPI Normalizer transforms the input OpenAPI doc/spec (which may not perfectl
- SIMPLIFY_ONEOF_ANYOF
- SIMPLIFY_BOOLEAN_ENUM
- REFACTOR_ALLOF_WITH_PROPERTIES_ONLY
(One can use `DISABLE_ALL=true` to disable all the rules)

View File

@ -160,6 +160,7 @@ public class OpenAPINormalizer {
// rules that are default to true
rules.put(SIMPLIFY_ONEOF_ANYOF, true);
rules.put(SIMPLIFY_BOOLEAN_ENUM, true);
rules.put(REFACTOR_ALLOF_WITH_PROPERTIES_ONLY, true); // default to true since v7.7.0
processRules(inputRules);

View File

@ -4589,8 +4589,11 @@ public class SpringCodegenTest {
// public Object4(Type1 pageInfo, String responseType, String requestId, Boolean success) {
// super(responseType, requestId, success, pageInfo);
// }
// UPDATE: with https://github.com/OpenAPITools/openapi-generator/pull/18238
// (REFACTOR_ALLOF_WITH_PROPERTIES_ONLY default to true)
// public Object4(String responseType, String requestId, Boolean success, Type1 pageInfo)
JavaFileAssert.assertThat(output.get("Object4.java"))
.assertConstructor("Type1", "String", "String", "Boolean")
.assertConstructor("String", "String", "Boolean", "Type1")
.hasParameter("responseType").toConstructor()
.hasParameter("requestId").toConstructor()
.hasParameter("success").toConstructor()

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
#[serde(rename = "foo", skip_serializing_if = "Option::is_none")]
pub foo: Option<Box<models::FooRefOrValue>>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
#[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<String>,
@ -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<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
#[serde(rename = "foo", skip_serializing_if = "Option::is_none")]
pub foo: Option<Box<models::FooRefOrValue>>,
}
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,
}
}
}

View File

@ -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<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
#[serde(rename = "foo", skip_serializing_if = "Option::is_none")]
pub foo: Option<Box<models::FooRefOrValue>>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
@ -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<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
#[serde(rename = "foo", skip_serializing_if = "Option::is_none")]
pub foo: Option<Box<models::FooRefOrValue>>,
}
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,
}
}
}

View File

@ -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<String>,
/// 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<String>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
@ -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<String>,
/// 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<String>,
}
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,
}
}
}

View File

@ -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<String>,
/// The actual type of the target instance when needed for disambiguation.
#[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")]
at_referred_type: Option<String>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
href: Option<String>,
@ -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<String>,
/// Name of the related entity.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
name: Option<String>,
/// The actual type of the target instance when needed for disambiguation.
#[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")]
at_referred_type: Option<String>,
},
#[serde(rename="FooRef")]
FooRef {
/// Name of the related entity.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
name: Option<String>,
/// The actual type of the target instance when needed for disambiguation.
#[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")]
at_referred_type: Option<String>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
href: Option<String>,
@ -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<String>,
/// Name of the related entity.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
name: Option<String>,
/// The actual type of the target instance when needed for disambiguation.
#[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")]
at_referred_type: Option<String>,
},
}
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(),
}
}

View File

@ -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<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
@ -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<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
}
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,
}
}
}

View File

@ -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<String>,
/// Name of the related entity.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// 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<String>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
@ -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<String>,
/// 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<String>,
#[serde(rename = "foorefPropA", skip_serializing_if = "Option::is_none")]
pub fooref_prop_a: Option<String>,
}
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,
}
}
}

View File

@ -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<String>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
@ -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<String>,
}
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,
}
}
}

View File

@ -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<f64>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
@ -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<f64>,
}
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,
}
}
}

View File

@ -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<String>,
#[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")]
pub pizza_size: Option<f64>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
@ -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<f64>,
#[serde(rename = "toppings", skip_serializing_if = "Option::is_none")]
pub toppings: Option<String>,
}
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,
}
}
}

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
#[serde(rename = "foo", skip_serializing_if = "Option::is_none")]
pub foo: Option<Box<models::FooRefOrValue>>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
#[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<String>,
@ -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<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
#[serde(rename = "foo", skip_serializing_if = "Option::is_none")]
pub foo: Option<Box<models::FooRefOrValue>>,
}
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,
}
}
}

View File

@ -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<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
#[serde(rename = "foo", skip_serializing_if = "Option::is_none")]
pub foo: Option<Box<models::FooRefOrValue>>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
@ -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<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
#[serde(rename = "foo", skip_serializing_if = "Option::is_none")]
pub foo: Option<Box<models::FooRefOrValue>>,
}
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,
}
}
}

View File

@ -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<String>,
/// 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<String>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
@ -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<String>,
/// 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<String>,
}
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,
}
}
}

View File

@ -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<String>,
/// The actual type of the target instance when needed for disambiguation.
#[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")]
at_referred_type: Option<String>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
href: Option<String>,
@ -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<String>,
/// Name of the related entity.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
name: Option<String>,
/// The actual type of the target instance when needed for disambiguation.
#[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")]
at_referred_type: Option<String>,
},
#[serde(rename="FooRef")]
FooRef {
/// Name of the related entity.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
name: Option<String>,
/// The actual type of the target instance when needed for disambiguation.
#[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")]
at_referred_type: Option<String>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
href: Option<String>,
@ -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<String>,
/// Name of the related entity.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
name: Option<String>,
/// The actual type of the target instance when needed for disambiguation.
#[serde(rename = "@referredType", skip_serializing_if = "Option::is_none")]
at_referred_type: Option<String>,
},
}
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(),
}
}

View File

@ -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<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
@ -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<String>,
#[serde(rename = "fooPropB", skip_serializing_if = "Option::is_none")]
pub foo_prop_b: Option<String>,
}
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,
}
}
}

View File

@ -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<String>,
/// Name of the related entity.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// 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<String>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
@ -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<String>,
/// 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<String>,
#[serde(rename = "foorefPropA", skip_serializing_if = "Option::is_none")]
pub fooref_prop_a: Option<String>,
}
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,
}
}
}

View File

@ -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<String>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
@ -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<String>,
}
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,
}
}
}

View File

@ -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<f64>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
@ -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<f64>,
}
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,
}
}
}

View File

@ -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<String>,
#[serde(rename = "pizzaSize", skip_serializing_if = "Option::is_none")]
pub pizza_size: Option<f64>,
/// Hyperlink reference
#[serde(rename = "href", skip_serializing_if = "Option::is_none")]
pub href: Option<String>,
@ -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<f64>,
#[serde(rename = "toppings", skip_serializing_if = "Option::is_none")]
pub toppings: Option<String>,
}
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,
}
}
}

View File

@ -64,8 +64,11 @@ components:
type: integer
type: object
- $ref: '#/components/schemas/Person'
description: A representation of a child
- description: A representation of a child
properties:
boosterSeat:
type: boolean
type: object
example: null
example: null

View File

@ -1,5 +1,4 @@
# Org.OpenAPITools.Model.Child
A representation of a child
## Properties

View File

@ -25,7 +25,7 @@ using Org.OpenAPITools.Client;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// A representation of a child
/// Child
/// </summary>
public partial class Child : Person, IValidatableObject
{
@ -33,11 +33,11 @@ namespace Org.OpenAPITools.Model
/// Initializes a new instance of the <see cref="Child" /> class.
/// </summary>
/// <param name="age">age</param>
/// <param name="boosterSeat">boosterSeat</param>
/// <param name="firstName">firstName</param>
/// <param name="lastName">lastName</param>
/// <param name="boosterSeat">boosterSeat</param>
[JsonConstructor]
public Child(Option<int?> age = default, Option<string> firstName = default, Option<string> lastName = default, Option<bool?> boosterSeat = default) : base(firstName, lastName)
public Child(Option<int?> age = default, Option<bool?> boosterSeat = default, Option<string> firstName = default, Option<string> lastName = default) : base(firstName, lastName)
{
AgeOption = age;
BoosterSeatOption = boosterSeat;
@ -59,13 +59,6 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("age")]
public int? Age { get { return this.AgeOption; } set { this.AgeOption = new Option<int?>(value); } }
/// <summary>
/// The discriminator
/// </summary>
[JsonIgnore]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public new string Type { get; } = "Child";
/// <summary>
/// Used to track the state of BoosterSeat
/// </summary>
@ -79,6 +72,13 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("boosterSeat")]
public bool? BoosterSeat { get { return this.BoosterSeatOption; } set { this.BoosterSeatOption = new Option<bool?>(value); } }
/// <summary>
/// The discriminator
/// </summary>
[JsonIgnore]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public new string Type { get; } = "Child";
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -118,10 +118,10 @@ namespace Org.OpenAPITools.Model
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
Option<int?> age = default;
Option<bool?> boosterSeat = default;
Option<string> firstName = default;
Option<string> lastName = default;
Option<string> type = default;
Option<bool?> boosterSeat = default;
while (utf8JsonReader.Read())
{
@ -142,6 +142,10 @@ namespace Org.OpenAPITools.Model
if (utf8JsonReader.TokenType != JsonTokenType.Null)
age = new Option<int?>(utf8JsonReader.GetInt32());
break;
case "boosterSeat":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
boosterSeat = new Option<bool?>(utf8JsonReader.GetBoolean());
break;
case "firstName":
firstName = new Option<string>(utf8JsonReader.GetString());
break;
@ -151,10 +155,6 @@ namespace Org.OpenAPITools.Model
case "$_type":
type = new Option<string>(utf8JsonReader.GetString());
break;
case "boosterSeat":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
boosterSeat = new Option<bool?>(utf8JsonReader.GetBoolean());
break;
default:
break;
}
@ -164,6 +164,9 @@ namespace Org.OpenAPITools.Model
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 @@ namespace Org.OpenAPITools.Model
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);
}
/// <summary>
@ -212,6 +212,9 @@ namespace Org.OpenAPITools.Model
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 @@ namespace Org.OpenAPITools.Model
writer.WriteString("lastName", child.LastName);
writer.WriteString("$_type", child.Type);
if (child.BoosterSeatOption.IsSet)
writer.WriteBoolean("boosterSeat", child.BoosterSeatOption.Value.Value);
}
}
}

View File

@ -64,8 +64,11 @@ components:
type: integer
type: object
- $ref: '#/components/schemas/Person'
description: A representation of a child
- description: A representation of a child
properties:
boosterSeat:
type: boolean
type: object
example: null
example: null

View File

@ -1,5 +1,4 @@
# Org.OpenAPITools.Model.Child
A representation of a child
## Properties

View File

@ -25,7 +25,7 @@ using Org.OpenAPITools.Client;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// A representation of a child
/// Child
/// </summary>
public partial class Child : Person, IValidatableObject
{
@ -33,11 +33,11 @@ namespace Org.OpenAPITools.Model
/// Initializes a new instance of the <see cref="Child" /> class.
/// </summary>
/// <param name="age">age</param>
/// <param name="boosterSeat">boosterSeat</param>
/// <param name="firstName">firstName</param>
/// <param name="lastName">lastName</param>
/// <param name="boosterSeat">boosterSeat</param>
[JsonConstructor]
public Child(Option<int?> age = default, Option<string> firstName = default, Option<string> lastName = default, Option<bool?> boosterSeat = default) : base(firstName, lastName)
public Child(Option<int?> age = default, Option<bool?> boosterSeat = default, Option<string> firstName = default, Option<string> lastName = default) : base(firstName, lastName)
{
AgeOption = age;
BoosterSeatOption = boosterSeat;
@ -59,13 +59,6 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("age")]
public int? Age { get { return this.AgeOption; } set { this.AgeOption = new Option<int?>(value); } }
/// <summary>
/// The discriminator
/// </summary>
[JsonIgnore]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public new string Type { get; } = "Child";
/// <summary>
/// Used to track the state of BoosterSeat
/// </summary>
@ -79,6 +72,13 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("boosterSeat")]
public bool? BoosterSeat { get { return this.BoosterSeatOption; } set { this.BoosterSeatOption = new Option<bool?>(value); } }
/// <summary>
/// The discriminator
/// </summary>
[JsonIgnore]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public new string Type { get; } = "Child";
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -118,10 +118,10 @@ namespace Org.OpenAPITools.Model
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
Option<int?> age = default;
Option<bool?> boosterSeat = default;
Option<string> firstName = default;
Option<string> lastName = default;
Option<string> type = default;
Option<bool?> boosterSeat = default;
while (utf8JsonReader.Read())
{
@ -142,6 +142,10 @@ namespace Org.OpenAPITools.Model
if (utf8JsonReader.TokenType != JsonTokenType.Null)
age = new Option<int?>(utf8JsonReader.GetInt32());
break;
case "boosterSeat":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
boosterSeat = new Option<bool?>(utf8JsonReader.GetBoolean());
break;
case "firstName":
firstName = new Option<string>(utf8JsonReader.GetString());
break;
@ -151,10 +155,6 @@ namespace Org.OpenAPITools.Model
case "$_type":
type = new Option<string>(utf8JsonReader.GetString());
break;
case "boosterSeat":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
boosterSeat = new Option<bool?>(utf8JsonReader.GetBoolean());
break;
default:
break;
}
@ -164,6 +164,9 @@ namespace Org.OpenAPITools.Model
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 @@ namespace Org.OpenAPITools.Model
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);
}
/// <summary>
@ -212,6 +212,9 @@ namespace Org.OpenAPITools.Model
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 @@ namespace Org.OpenAPITools.Model
writer.WriteString("lastName", child.LastName);
writer.WriteString("$_type", child.Type);
if (child.BoosterSeatOption.IsSet)
writer.WriteBoolean("boosterSeat", child.BoosterSeatOption.Value.Value);
}
}
}

View File

@ -64,8 +64,11 @@ components:
type: integer
type: object
- $ref: '#/components/schemas/Person'
description: A representation of a child
- description: A representation of a child
properties:
boosterSeat:
type: boolean
type: object
example: null
example: null

View File

@ -1,5 +1,4 @@
# Org.OpenAPITools.Model.Child
A representation of a child
## Properties

View File

@ -27,7 +27,7 @@ using Org.OpenAPITools.Client;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// A representation of a child
/// Child
/// </summary>
public partial class Child : Person, IValidatableObject
{
@ -35,11 +35,11 @@ namespace Org.OpenAPITools.Model
/// Initializes a new instance of the <see cref="Child" /> class.
/// </summary>
/// <param name="age">age</param>
/// <param name="boosterSeat">boosterSeat</param>
/// <param name="firstName">firstName</param>
/// <param name="lastName">lastName</param>
/// <param name="boosterSeat">boosterSeat</param>
[JsonConstructor]
public Child(Option<int?> age = default, Option<string?> firstName = default, Option<string?> lastName = default, Option<bool?> boosterSeat = default) : base(firstName, lastName)
public Child(Option<int?> age = default, Option<bool?> boosterSeat = default, Option<string?> firstName = default, Option<string?> lastName = default) : base(firstName, lastName)
{
AgeOption = age;
BoosterSeatOption = boosterSeat;
@ -61,13 +61,6 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("age")]
public int? Age { get { return this.AgeOption; } set { this.AgeOption = new(value); } }
/// <summary>
/// The discriminator
/// </summary>
[JsonIgnore]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public new string Type { get; } = "Child";
/// <summary>
/// Used to track the state of BoosterSeat
/// </summary>
@ -81,6 +74,13 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("boosterSeat")]
public bool? BoosterSeat { get { return this.BoosterSeatOption; } set { this.BoosterSeatOption = new(value); } }
/// <summary>
/// The discriminator
/// </summary>
[JsonIgnore]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public new string Type { get; } = "Child";
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@ -120,10 +120,10 @@ namespace Org.OpenAPITools.Model
JsonTokenType startingTokenType = utf8JsonReader.TokenType;
Option<int?> age = default;
Option<bool?> boosterSeat = default;
Option<string?> firstName = default;
Option<string?> lastName = default;
Option<string?> type = default;
Option<bool?> boosterSeat = default;
while (utf8JsonReader.Read())
{
@ -144,6 +144,10 @@ namespace Org.OpenAPITools.Model
if (utf8JsonReader.TokenType != JsonTokenType.Null)
age = new Option<int?>(utf8JsonReader.GetInt32());
break;
case "boosterSeat":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
boosterSeat = new Option<bool?>(utf8JsonReader.GetBoolean());
break;
case "firstName":
firstName = new Option<string?>(utf8JsonReader.GetString()!);
break;
@ -153,10 +157,6 @@ namespace Org.OpenAPITools.Model
case "$_type":
type = new Option<string?>(utf8JsonReader.GetString()!);
break;
case "boosterSeat":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
boosterSeat = new Option<bool?>(utf8JsonReader.GetBoolean());
break;
default:
break;
}
@ -166,6 +166,9 @@ namespace Org.OpenAPITools.Model
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 @@ namespace Org.OpenAPITools.Model
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);
}
/// <summary>
@ -214,6 +214,9 @@ namespace Org.OpenAPITools.Model
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 @@ namespace Org.OpenAPITools.Model
writer.WriteString("lastName", child.LastName);
writer.WriteString("$_type", child.Type);
if (child.BoosterSeatOption.IsSet)
writer.WriteBoolean("boosterSeat", child.BoosterSeatOption.Value!.Value);
}
}
}

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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]

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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<Bar, BarBuilder> {
@BuiltValueField(wireName: r'foo')

View File

@ -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<BarCreate, BarCreateBuilder> {
@BuiltValueField(wireName: r'foo')

View File

@ -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, BarRefBuilder> {
BarRef._();

View File

@ -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()

View File

@ -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.

View File

@ -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<Foo, FooBuilder> {
@BuiltValueField(wireName: r'fooPropA')

View File

@ -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<FooRef, FooRefBuilder> {
@BuiltValueField(wireName: r'foorefPropA')

View File

@ -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<FooRefOrValue, FooRefOrValueBuilder> {
/// One Of [Foo], [FooRef]

View File

@ -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<Pasta, PastaBuilder> {
@BuiltValueField(wireName: r'vendor')

View File

@ -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')

View File

@ -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<PizzaSpeziale, PizzaSpezialeBuilder> {
@BuiltValueField(wireName: r'toppings')

View File

@ -692,15 +692,7 @@ components:
allOf:
- $ref: '#/components/schemas/OrderInfo'
- $ref: '#/components/schemas/SpecialInfo'
description: An order for a pets from the pet store
example:
petId: 6
quantity: 1
comment: comment
id: 0
shipDate: 2000-01-23T04:56:07.000+00:00
complete: false
status: placed
- description: An order for a pets from the pet store
properties:
id:
format: int64
@ -731,6 +723,19 @@ components:
- comment
title: Pet Order
type: object
example: null
example:
petId: 5
quantity: 5
requireTest: requireTest
comment: comment
id: 1
shipDate: 2000-01-23T04:56:07.000+00:00
type: type
complete: false
promotion: true
status: placed
type: object
xml:
name: Order
Category:

View File

@ -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
}

View File

@ -71,7 +71,7 @@ public interface BarApi {
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;
}

View File

@ -71,7 +71,7 @@ public interface FooApi {
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 @@ public interface FooApi {
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;
}

View File

@ -38,16 +38,6 @@ public class BarRef extends EntityRef implements BarRefOrValue {
}
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 class BarRef extends EntityRef implements BarRefOrValue {
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 @@ public class BarRef extends EntityRef implements BarRefOrValue {
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 class BarRef extends EntityRef implements BarRefOrValue {
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.
*

View File

@ -18,10 +18,9 @@ import java.util.*;
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 @@ import javax.annotation.Generated;
@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 class EntityRef {
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 class EntityRef {
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 class EntityRef {
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,23 +261,13 @@ public class EntityRef {
}
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);
return this;
}
public EntityRef.Builder name(String name) {
this.instance.name(name);
return this;
}
public EntityRef.Builder atReferredType(String atReferredType) {
this.instance.atReferredType(atReferredType);
this.instance.setName(value.name);
this.instance.setAtReferredType(value.atReferredType);
return this;
}
@ -307,6 +296,16 @@ public class EntityRef {
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.
*

View File

@ -60,16 +60,6 @@ public class FooRef extends EntityRef implements FooRefOrValue {
}
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 class FooRef extends EntityRef implements FooRefOrValue {
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 class FooRef extends EntityRef implements FooRefOrValue {
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 class FooRef extends EntityRef implements FooRefOrValue {
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.
*

View File

@ -135,9 +135,7 @@ components:
allOf:
- $ref: '#/components/schemas/Addressable'
- $ref: '#/components/schemas/Extensible'
description: Entity reference schema to be use for all entityRef class.
discriminator:
propertyName: '@type'
- description: Entity reference schema to be use for all entityRef class.
properties:
name:
description: Name of the related entity.
@ -146,6 +144,11 @@ components:
description: The actual type of the target instance when needed for disambiguation.
type: string
type: object
example: null
discriminator:
propertyName: '@type'
type: object
example: null
FooRefOrValue:
discriminator:
propertyName: '@type'
@ -157,22 +160,32 @@ components:
Foo:
allOf:
- $ref: '#/components/schemas/Entity'
example:
fooPropA: fooPropA
fooPropB: fooPropB
properties:
- properties:
fooPropA:
type: string
fooPropB:
type: string
type: object
example: null
example:
'@baseType': '@baseType'
'@type': '@type'
fooPropA: fooPropA
href: href
id: id
fooPropB: fooPropB
'@schemaLocation': '@schemaLocation'
type: object
FooRef:
allOf:
- $ref: '#/components/schemas/EntityRef'
properties:
- properties:
foorefPropA:
type: string
type: object
example: null
type: object
example: null
BarRef:
allOf:
- $ref: '#/components/schemas/EntityRef'
@ -180,7 +193,7 @@ components:
Bar_Create:
allOf:
- $ref: '#/components/schemas/Entity'
properties:
- properties:
barPropA:
type: string
fooPropB:
@ -188,17 +201,13 @@ components:
foo:
$ref: '#/components/schemas/FooRefOrValue'
type: object
example: null
type: object
example: null
Bar:
allOf:
- $ref: '#/components/schemas/Entity'
example:
foo:
fooPropA: fooPropA
fooPropB: fooPropB
id: id
fooPropB: fooPropB
barPropA: barPropA
properties:
- properties:
id:
type: string
barPropA:
@ -210,6 +219,24 @@ components:
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
type: object
BarRefOrValue:
oneOf:
- $ref: '#/components/schemas/Bar'
@ -219,24 +246,33 @@ components:
Pizza:
allOf:
- $ref: '#/components/schemas/Entity'
properties:
- properties:
pizzaSize:
type: number
type: object
example: null
type: object
example: null
Pasta:
allOf:
- $ref: '#/components/schemas/Entity'
properties:
- properties:
vendor:
type: string
type: object
example: null
type: object
example: null
PizzaSpeziale:
allOf:
- $ref: '#/components/schemas/Pizza'
properties:
- properties:
toppings:
type: string
type: object
example: null
type: object
example: null
FruitType:
enum:
- APPLE

View File

@ -948,15 +948,7 @@ components:
allOf:
- $ref: '#/components/schemas/OrderInfo'
- $ref: '#/components/schemas/SpecialInfo'
description: An order for a pets from the pet store
example:
petId: 6
quantity: 1
comment: comment
id: 0
shipDate: 2000-01-23T04:56:07.000+00:00
complete: false
status: placed
- description: An order for a pets from the pet store
properties:
id:
format: int64
@ -987,6 +979,18 @@ components:
- comment
title: Pet Order
type: object
example: null
example:
petId: 5
quantity: 5
comment: comment
id: 1
shipDate: 2000-01-23T04:56:07.000+00:00
type: type
complete: false
promotion: true
status: placed
type: object
xml:
name: Order
Category:

View File

@ -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
}

View File

@ -948,15 +948,7 @@ components:
allOf:
- $ref: '#/components/schemas/OrderInfo'
- $ref: '#/components/schemas/SpecialInfo'
description: An order for a pets from the pet store
example:
petId: 6
quantity: 1
comment: comment
id: 0
shipDate: 2000-01-23T04:56:07.000+00:00
complete: false
status: placed
- description: An order for a pets from the pet store
properties:
id:
format: int64
@ -987,6 +979,18 @@ components:
- comment
title: Pet Order
type: object
example: null
example:
petId: 5
quantity: 5
comment: comment
id: 1
shipDate: 2000-01-23T04:56:07.000+00:00
type: type
complete: false
promotion: true
status: placed
type: object
xml:
name: Order
Category:

View File

@ -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
}

View File

@ -146,11 +146,14 @@ components:
allOfObject:
allOf:
- $ref: '#/components/schemas/baseAllOf'
example:
sampleProperty: sampleProperty
properties:
- properties:
sampleProperty:
type: string
type: object
example: null
example:
sampleProperty: sampleProperty
sampleBaseProperty: sampleBaseProperty
baseAllOf:
properties:
sampleBaseProperty:

View File

@ -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)

View File

@ -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<String>,
#[serde(rename = "sampleBaseProperty")]
#[serde(skip_serializing_if="Option::is_none")]
pub sample_base_property: Option<String>,
#[serde(rename = "sampleProperty")]
#[serde(skip_serializing_if="Option::is_none")]
pub sample_property: Option<String>,
}
@ -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,14 +224,6 @@ impl std::string::ToString for AllOfObject {
fn to_string(&self) -> String {
let params: Vec<Option<String>> = vec![
self.sample_property.as_ref().map(|sample_property| {
[
"sampleProperty".to_string(),
sample_property.to_string(),
].join(",")
}),
self.sample_base_property.as_ref().map(|sample_base_property| {
[
"sampleBaseProperty".to_string(),
@ -239,6 +231,14 @@ impl std::string::ToString for AllOfObject {
].join(",")
}),
self.sample_property.as_ref().map(|sample_property| {
[
"sampleProperty".to_string(),
sample_property.to_string(),
].join(",")
}),
];
params.into_iter().flatten().collect::<Vec<_>>().join(",")
@ -256,8 +256,8 @@ impl std::str::FromStr for AllOfObject {
#[derive(Default)]
#[allow(dead_code)]
struct IntermediateRep {
pub sample_property: Vec<String>,
pub sample_base_property: Vec<String>,
pub sample_property: Vec<String>,
}
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(<String as std::str::FromStr>::from_str(val).map_err(|x| x.to_string())?),
#[allow(clippy::redundant_clone)]
"sampleBaseProperty" => intermediate_rep.sample_base_property.push(<String as std::str::FromStr>::from_str(val).map_err(|x| x.to_string())?),
#[allow(clippy::redundant_clone)]
"sampleProperty" => intermediate_rep.sample_property.push(<String as std::str::FromStr>::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(),
})
}
}