From 29ba17149c8a30ba77ce354eb4b0f46b172adb33 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 1 Oct 2024 16:35:09 +0800 Subject: [PATCH] update samples --- .../java/okhttp-gson-3.1/api/openapi.yaml | 8 ++------ .../java/okhttp-gson-3.1/docs/AnyTypeTest.md | 2 +- .../openapitools/client/model/AnyTypeTest.java | 10 +++++----- .../src/models/numeric_enum_testing.rs | 16 ++++++++-------- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/samples/client/petstore/java/okhttp-gson-3.1/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-3.1/api/openapi.yaml index 489ebd8ff4ba..28503edd8b0d 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-3.1/api/openapi.yaml @@ -1099,9 +1099,7 @@ components: ref_array_prefix_items: description: | An item that was added to the queue. - items: - description: TODO default missing array inner type to string - type: string + items: {} maxItems: 5 minItems: 3 type: array @@ -1112,9 +1110,7 @@ components: ArrayPrefixItems: description: | An item that was added to the queue. - items: - description: TODO default missing array inner type to string - type: string + items: {} maxItems: 5 minItems: 3 type: array diff --git a/samples/client/petstore/java/okhttp-gson-3.1/docs/AnyTypeTest.md b/samples/client/petstore/java/okhttp-gson-3.1/docs/AnyTypeTest.md index a9f7efb0ff66..a96a098853db 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/docs/AnyTypeTest.md +++ b/samples/client/petstore/java/okhttp-gson-3.1/docs/AnyTypeTest.md @@ -9,7 +9,7 @@ |------------ | ------------- | ------------- | -------------| |**anyTypeProperty** | **Object** | | [optional] | |**arrayProp** | **List<String>** | test array in 3.1 spec | [optional] | -|**refArrayPrefixItems** | **List<String>** | An item that was added to the queue. | [optional] | +|**refArrayPrefixItems** | **List<Object>** | An item that was added to the queue. | [optional] | diff --git a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/AnyTypeTest.java b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/AnyTypeTest.java index 5c5bfd2d8003..699cb9a7d40b 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/AnyTypeTest.java +++ b/samples/client/petstore/java/okhttp-gson-3.1/src/main/java/org/openapitools/client/model/AnyTypeTest.java @@ -63,7 +63,7 @@ public class AnyTypeTest { public static final String SERIALIZED_NAME_REF_ARRAY_PREFIX_ITEMS = "ref_array_prefix_items"; @SerializedName(SERIALIZED_NAME_REF_ARRAY_PREFIX_ITEMS) - private List refArrayPrefixItems = new ArrayList<>(); + private List refArrayPrefixItems = new ArrayList<>(); public AnyTypeTest() { } @@ -114,12 +114,12 @@ public void setArrayProp(List arrayProp) { } - public AnyTypeTest refArrayPrefixItems(List refArrayPrefixItems) { + public AnyTypeTest refArrayPrefixItems(List refArrayPrefixItems) { this.refArrayPrefixItems = refArrayPrefixItems; return this; } - public AnyTypeTest addRefArrayPrefixItemsItem(String refArrayPrefixItemsItem) { + public AnyTypeTest addRefArrayPrefixItemsItem(Object refArrayPrefixItemsItem) { if (this.refArrayPrefixItems == null) { this.refArrayPrefixItems = new ArrayList<>(); } @@ -132,11 +132,11 @@ public AnyTypeTest addRefArrayPrefixItemsItem(String refArrayPrefixItemsItem) { * @return refArrayPrefixItems */ @javax.annotation.Nullable - public List getRefArrayPrefixItems() { + public List getRefArrayPrefixItems() { return refArrayPrefixItems; } - public void setRefArrayPrefixItems(List refArrayPrefixItems) { + public void setRefArrayPrefixItems(List refArrayPrefixItems) { this.refArrayPrefixItems = refArrayPrefixItems; } diff --git a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/numeric_enum_testing.rs b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/numeric_enum_testing.rs index 9b8f0cb04651..e3681aa61778 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/numeric_enum_testing.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async-tokensource/src/models/numeric_enum_testing.rs @@ -24,14 +24,14 @@ pub enum NumericEnumTesting { } -impl ToString for NumericEnumTesting { - fn to_string(&self) -> String { - match self { - Self::Variant0 => String::from("0"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant3 => String::from("3"), - } +impl std::fmt::Display for NumericEnumTesting { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", match self { + Self::Variant0 => "0", + Self::Variant1 => "1", + Self::Variant2 => "2", + Self::Variant3 => "3", + }) } } impl Default for NumericEnumTesting {