diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java
index b9ed1c9eba38..d5d9b348c44e 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/InlineModelResolver.java
@@ -862,9 +862,20 @@ private String matchGenerated(Schema model) {
}
// Structural match: compare with volatile fields stripped at every level.
// See generatedStructuralSignature field for a full explanation of why this is needed.
- String structural = computeStructuralSignature(model);
- if (generatedStructuralSignature.containsKey(structural)) {
- return generatedStructuralSignature.get(structural);
+ //
+ // Only applied to *titled* schemas. A title denotes a named type that should be reused
+ // wherever it appears, so parser-induced volatile differences (description, type,
+ // example) must not split it into numbered duplicates. Anonymous/untitled inline
+ // schemas, however, may be intentionally distinct even when structurally identical once
+ // those volatile fields are stripped (e.g. two response properties that differ only by
+ // description) — unifying them silently changes the generated type of one property and
+ // breaks user code. This mirrors the titled-only guards in flatten() pre-population and
+ // deduplicateComponents().
+ if (model.getTitle() != null) {
+ String structural = computeStructuralSignature(model);
+ if (generatedStructuralSignature.containsKey(structural)) {
+ return generatedStructuralSignature.get(structural);
+ }
}
} catch (JsonProcessingException e) {
e.printStackTrace();
@@ -876,7 +887,11 @@ private String matchGenerated(Schema model) {
private void addGenerated(String name, Schema model) {
try {
generatedSignature.put(structureMapper.writeValueAsString(model), name);
- generatedStructuralSignature.putIfAbsent(computeStructuralSignature(model), name);
+ // Only register the volatile-stripped structural signature for titled schemas; untitled
+ // inline schemas must not participate in the structural-match fallback (see matchGenerated).
+ if (model.getTitle() != null) {
+ generatedStructuralSignature.putIfAbsent(computeStructuralSignature(model), name);
+ }
} catch (JsonProcessingException e) {
e.printStackTrace();
}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java
index 61bf18b51b11..290a84fb3ca7 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/InlineModelResolverTest.java
@@ -274,6 +274,61 @@ public void resolveInlineModelDeduplicatesWhenParserMutatesPropertyDescriptions(
assertNull("Duplicate Widget_1 must not exist — shape-fingerprint dedup must fire", schemas.get("Widget_1"));
}
+ @Test
+ public void resolveInlineModelKeepsUntitledSchemasDifferingOnlyByDescriptionDistinct() {
+ // Regression test for #24004: two distinct *untitled* inline object schemas that differ
+ // only in their descriptions (here the nested 'result' property: "ABC Result" vs
+ // "DEF Result") must NOT be merged. The volatile-stripped structural-signature fallback in
+ // matchGenerated() collapses them once description/type are removed; that fallback is only
+ // intended to unify titled named types across parser volatility, so it must not fire for
+ // untitled inline schemas — otherwise 'def' silently gets the type generated for 'abc' and
+ // breaks user code that expects two separate types (regression introduced in 7.23).
+ OpenAPI openapi = new OpenAPI();
+ openapi.setComponents(new Components());
+ openapi.setPaths(new Paths());
+
+ Schema abc = new ObjectSchema()
+ .description("first container")
+ .addProperty("result", new StringSchema().description("ABC Result"));
+ Schema def = new ObjectSchema()
+ .description("second container")
+ .addProperty("result", new StringSchema().description("DEF Result"));
+
+ Schema response = new ObjectSchema()
+ .addProperty("abc", abc)
+ .addProperty("def", def);
+
+ ApiResponse apiResponse = new ApiResponse()
+ .description("OK")
+ .content(new Content().addMediaType("application/json",
+ new MediaType().schema(response)));
+
+ openapi.getPaths().addPathItem("/default", new PathItem().get(
+ new Operation().operationId("apiGetDefault")
+ .responses(new ApiResponses().addApiResponse("200", apiResponse))));
+
+ new InlineModelResolver().flatten(openapi);
+
+ // Locate the flattened response model (the only component schema carrying both properties).
+ Schema responseModel = null;
+ for (Schema candidate : openapi.getComponents().getSchemas().values()) {
+ if (candidate.getProperties() != null
+ && candidate.getProperties().containsKey("abc")
+ && candidate.getProperties().containsKey("def")) {
+ responseModel = candidate;
+ break;
+ }
+ }
+ assertNotNull("Flattened response model with abc/def properties must exist", responseModel);
+
+ String abcRef = ((Schema) responseModel.getProperties().get("abc")).get$ref();
+ String defRef = ((Schema) responseModel.getProperties().get("def")).get$ref();
+ assertNotNull("abc property must be a $ref to a generated schema", abcRef);
+ assertNotNull("def property must be a $ref to a generated schema", defRef);
+ assertFalse("abc and def must resolve to DISTINCT schemas, not be merged: " + abcRef,
+ abcRef.equals(defRef));
+ }
+
@Test
public void resolveInlineModelDeduplicatesMultipleRefsToSameExternalFile() {
// Regression test: when the same external schema file is referenced from three separate
diff --git a/samples/client/others/crystal-qdrant/.openapi-generator/FILES b/samples/client/others/crystal-qdrant/.openapi-generator/FILES
index 74586c986b63..c472dac2f6e7 100644
--- a/samples/client/others/crystal-qdrant/.openapi-generator/FILES
+++ b/samples/client/others/crystal-qdrant/.openapi-generator/FILES
@@ -122,6 +122,8 @@ src/qdrant-api/models/facet_value.cr
src/qdrant-api/models/facet_value_hit.cr
src/qdrant-api/models/field_condition.cr
src/qdrant-api/models/filter.cr
+src/qdrant-api/models/filter_must.cr
+src/qdrant-api/models/filter_must_not.cr
src/qdrant-api/models/filter_selector.cr
src/qdrant-api/models/filter_should.cr
src/qdrant-api/models/float_index_params.cr
@@ -215,6 +217,7 @@ src/qdrant-api/models/points_batch.cr
src/qdrant-api/models/points_list.cr
src/qdrant-api/models/points_selector.cr
src/qdrant-api/models/prefetch.cr
+src/qdrant-api/models/prefetch_prefetch.cr
src/qdrant-api/models/product_quantization.cr
src/qdrant-api/models/product_quantization_config.cr
src/qdrant-api/models/quantization_config.cr
@@ -312,6 +315,7 @@ src/qdrant-api/models/text_index_type.cr
src/qdrant-api/models/tokenizer_type.cr
src/qdrant-api/models/tracker_status.cr
src/qdrant-api/models/tracker_status_one_of.cr
+src/qdrant-api/models/tracker_status_one_of1.cr
src/qdrant-api/models/tracker_telemetry.cr
src/qdrant-api/models/update_collection.cr
src/qdrant-api/models/update_operation.cr
diff --git a/samples/client/others/crystal-qdrant/spec/models/filter_must_not_spec.cr b/samples/client/others/crystal-qdrant/spec/models/filter_must_not_spec.cr
new file mode 100644
index 000000000000..f32029967306
--- /dev/null
+++ b/samples/client/others/crystal-qdrant/spec/models/filter_must_not_spec.cr
@@ -0,0 +1,20 @@
+# #Qdrant API
+#
+#The version of the OpenAPI document: master
+#Contact: andrey@vasnetsov.com
+#Generated by: https://openapi-generator.tech
+#Generator version: 7.24.0-SNAPSHOT
+#
+
+require "../spec_helper"
+
+# Unit tests for Qdrant::Api::FilterMustNot
+# Automatically generated by openapi-generator (https://openapi-generator.tech)
+# Please update as you see appropriate
+Spectator.describe Qdrant::Api::FilterMustNot do
+ describe "union (anyOf)" do
+ it "is (de)serialisable as a union alias" do
+ expect(Qdrant::Api::FilterMustNot.responds_to?(:from_json)).to be_true
+ end
+ end
+end
diff --git a/samples/client/others/crystal-qdrant/spec/models/filter_must_spec.cr b/samples/client/others/crystal-qdrant/spec/models/filter_must_spec.cr
new file mode 100644
index 000000000000..62281660ee8d
--- /dev/null
+++ b/samples/client/others/crystal-qdrant/spec/models/filter_must_spec.cr
@@ -0,0 +1,20 @@
+# #Qdrant API
+#
+#The version of the OpenAPI document: master
+#Contact: andrey@vasnetsov.com
+#Generated by: https://openapi-generator.tech
+#Generator version: 7.24.0-SNAPSHOT
+#
+
+require "../spec_helper"
+
+# Unit tests for Qdrant::Api::FilterMust
+# Automatically generated by openapi-generator (https://openapi-generator.tech)
+# Please update as you see appropriate
+Spectator.describe Qdrant::Api::FilterMust do
+ describe "union (anyOf)" do
+ it "is (de)serialisable as a union alias" do
+ expect(Qdrant::Api::FilterMust.responds_to?(:from_json)).to be_true
+ end
+ end
+end
diff --git a/samples/client/others/crystal-qdrant/spec/models/prefetch_prefetch_spec.cr b/samples/client/others/crystal-qdrant/spec/models/prefetch_prefetch_spec.cr
new file mode 100644
index 000000000000..188984b924f0
--- /dev/null
+++ b/samples/client/others/crystal-qdrant/spec/models/prefetch_prefetch_spec.cr
@@ -0,0 +1,20 @@
+# #Qdrant API
+#
+#The version of the OpenAPI document: master
+#Contact: andrey@vasnetsov.com
+#Generated by: https://openapi-generator.tech
+#Generator version: 7.24.0-SNAPSHOT
+#
+
+require "../spec_helper"
+
+# Unit tests for Qdrant::Api::PrefetchPrefetch
+# Automatically generated by openapi-generator (https://openapi-generator.tech)
+# Please update as you see appropriate
+Spectator.describe Qdrant::Api::PrefetchPrefetch do
+ describe "union (anyOf)" do
+ it "is (de)serialisable as a union alias" do
+ expect(Qdrant::Api::PrefetchPrefetch.responds_to?(:from_json)).to be_true
+ end
+ end
+end
diff --git a/samples/client/others/crystal-qdrant/spec/models/tracker_status_one_of1_spec.cr b/samples/client/others/crystal-qdrant/spec/models/tracker_status_one_of1_spec.cr
new file mode 100644
index 000000000000..c77cc1916426
--- /dev/null
+++ b/samples/client/others/crystal-qdrant/spec/models/tracker_status_one_of1_spec.cr
@@ -0,0 +1,24 @@
+# #Qdrant API
+#
+#The version of the OpenAPI document: master
+#Contact: andrey@vasnetsov.com
+#Generated by: https://openapi-generator.tech
+#Generator version: 7.24.0-SNAPSHOT
+#
+
+require "../spec_helper"
+
+# Unit tests for Qdrant::Api::TrackerStatusOneOf1
+# Automatically generated by openapi-generator (https://openapi-generator.tech)
+# Please update as you see appropriate
+Spectator.describe Qdrant::Api::TrackerStatusOneOf1 do
+ describe "required-field enforcement" do
+ # A required, non-nilable property without a default makes JSON::Serializable
+ # reject a document that omits it. (Assumes at least one required field has no
+ # default; models where every required field has a default are not present in
+ # the generated samples.)
+ it "raises when required properties are missing" do
+ expect { Qdrant::Api::TrackerStatusOneOf1.from_json("{}") }.to raise_error(JSON::SerializableError)
+ end
+ end
+end
diff --git a/samples/client/others/crystal-qdrant/src/qdrant-api.cr b/samples/client/others/crystal-qdrant/src/qdrant-api.cr
index a8f474f6a186..39d34fdb5a61 100644
--- a/samples/client/others/crystal-qdrant/src/qdrant-api.cr
+++ b/samples/client/others/crystal-qdrant/src/qdrant-api.cr
@@ -119,6 +119,8 @@ require "./qdrant-api/models/facet_value"
require "./qdrant-api/models/facet_value_hit"
require "./qdrant-api/models/field_condition"
require "./qdrant-api/models/filter"
+require "./qdrant-api/models/filter_must"
+require "./qdrant-api/models/filter_must_not"
require "./qdrant-api/models/filter_selector"
require "./qdrant-api/models/filter_should"
require "./qdrant-api/models/float_index_params"
@@ -212,6 +214,7 @@ require "./qdrant-api/models/points_batch"
require "./qdrant-api/models/points_list"
require "./qdrant-api/models/points_selector"
require "./qdrant-api/models/prefetch"
+require "./qdrant-api/models/prefetch_prefetch"
require "./qdrant-api/models/product_quantization"
require "./qdrant-api/models/product_quantization_config"
require "./qdrant-api/models/quantization_config"
@@ -309,6 +312,7 @@ require "./qdrant-api/models/text_index_type"
require "./qdrant-api/models/tokenizer_type"
require "./qdrant-api/models/tracker_status"
require "./qdrant-api/models/tracker_status_one_of"
+require "./qdrant-api/models/tracker_status_one_of1"
require "./qdrant-api/models/tracker_telemetry"
require "./qdrant-api/models/update_collection"
require "./qdrant-api/models/update_operation"
diff --git a/samples/client/others/crystal-qdrant/src/qdrant-api/models/filter.cr b/samples/client/others/crystal-qdrant/src/qdrant-api/models/filter.cr
index eb74aab6139d..b4c0f75e5026 100644
--- a/samples/client/others/crystal-qdrant/src/qdrant-api/models/filter.cr
+++ b/samples/client/others/crystal-qdrant/src/qdrant-api/models/filter.cr
@@ -22,15 +22,15 @@ module Qdrant::Api
property min_should : MinShould?
@[JSON::Field(key: "must", emit_null: false)]
- property must : FilterShould?
+ property must : FilterMust?
@[JSON::Field(key: "must_not", emit_null: false)]
- property must_not : FilterShould?
+ property must_not : FilterMustNot?
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
- def initialize(@should : FilterShould? = nil, @min_should : MinShould? = nil, @must : FilterShould? = nil, @must_not : FilterShould? = nil)
+ def initialize(@should : FilterShould? = nil, @min_should : MinShould? = nil, @must : FilterMust? = nil, @must_not : FilterMustNot? = nil)
end
# Show invalid properties with the reasons. Usually used together with valid?
diff --git a/samples/client/others/crystal-qdrant/src/qdrant-api/models/filter_must.cr b/samples/client/others/crystal-qdrant/src/qdrant-api/models/filter_must.cr
new file mode 100644
index 000000000000..0fbfddc7d31d
--- /dev/null
+++ b/samples/client/others/crystal-qdrant/src/qdrant-api/models/filter_must.cr
@@ -0,0 +1,71 @@
+# #Qdrant API
+#
+#The version of the OpenAPI document: master
+#Contact: andrey@vasnetsov.com
+#Generated by: https://openapi-generator.tech
+#Generator version: 7.24.0-SNAPSHOT
+#
+
+module Qdrant::Api
+ # All conditions must match
+ # FilterMust (OpenAPI anyOf): a value matching at least one of the listed schemas.
+ # Implemented as a thin wrapper that (de)serialises by trying each member in order
+ # (the first that parses wins), so it transparently handles scalar, array and object members.
+ class FilterMust
+ getter value
+
+ def initialize(@value : Array(Condition))
+ end
+ def initialize(@value : Condition)
+ end
+
+ # List of classes defined in anyOf (OpenAPI v3)
+ def self.openapi_any_of
+ [
+ Array(Condition), Condition
+ ]
+ end
+
+ def self.from_json(string_or_io) : self
+ from_json_any(JSON.parse(string_or_io))
+ end
+
+ def self.new(pull : JSON::PullParser)
+ from_json_any(JSON::Any.new(pull))
+ end
+
+ def self.from_json_any(data : JSON::Any) : self
+ json = data.to_json
+ begin
+ return new(Array(Condition).from_json(json))
+ rescue JSON::ParseException | ArgumentError | TypeCastError
+ end
+ begin
+ return new(Condition.from_json(json))
+ rescue JSON::ParseException | ArgumentError | TypeCastError
+ end
+ raise JSON::ParseException.new("`#{json}` doesn't match any schema listed in FilterMust (anyOf)", 0, 0)
+ end
+
+ def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
+ begin
+ return new(Array(Condition).new(ctx, node))
+ rescue YAML::ParseException | ArgumentError | TypeCastError
+ end
+ begin
+ return new(Condition.new(ctx, node))
+ rescue YAML::ParseException | ArgumentError | TypeCastError
+ end
+ raise YAML::ParseException.new("doesn't match any schema listed in FilterMust (anyOf)", 0, 0)
+ end
+
+ def to_json(builder : JSON::Builder)
+ @value.to_json(builder)
+ end
+
+ def to_yaml(builder : YAML::Nodes::Builder)
+ @value.to_yaml(builder)
+ end
+ end
+
+end
diff --git a/samples/client/others/crystal-qdrant/src/qdrant-api/models/filter_must_not.cr b/samples/client/others/crystal-qdrant/src/qdrant-api/models/filter_must_not.cr
new file mode 100644
index 000000000000..69bfa144ccb2
--- /dev/null
+++ b/samples/client/others/crystal-qdrant/src/qdrant-api/models/filter_must_not.cr
@@ -0,0 +1,71 @@
+# #Qdrant API
+#
+#The version of the OpenAPI document: master
+#Contact: andrey@vasnetsov.com
+#Generated by: https://openapi-generator.tech
+#Generator version: 7.24.0-SNAPSHOT
+#
+
+module Qdrant::Api
+ # All conditions must NOT match
+ # FilterMustNot (OpenAPI anyOf): a value matching at least one of the listed schemas.
+ # Implemented as a thin wrapper that (de)serialises by trying each member in order
+ # (the first that parses wins), so it transparently handles scalar, array and object members.
+ class FilterMustNot
+ getter value
+
+ def initialize(@value : Array(Condition))
+ end
+ def initialize(@value : Condition)
+ end
+
+ # List of classes defined in anyOf (OpenAPI v3)
+ def self.openapi_any_of
+ [
+ Array(Condition), Condition
+ ]
+ end
+
+ def self.from_json(string_or_io) : self
+ from_json_any(JSON.parse(string_or_io))
+ end
+
+ def self.new(pull : JSON::PullParser)
+ from_json_any(JSON::Any.new(pull))
+ end
+
+ def self.from_json_any(data : JSON::Any) : self
+ json = data.to_json
+ begin
+ return new(Array(Condition).from_json(json))
+ rescue JSON::ParseException | ArgumentError | TypeCastError
+ end
+ begin
+ return new(Condition.from_json(json))
+ rescue JSON::ParseException | ArgumentError | TypeCastError
+ end
+ raise JSON::ParseException.new("`#{json}` doesn't match any schema listed in FilterMustNot (anyOf)", 0, 0)
+ end
+
+ def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
+ begin
+ return new(Array(Condition).new(ctx, node))
+ rescue YAML::ParseException | ArgumentError | TypeCastError
+ end
+ begin
+ return new(Condition.new(ctx, node))
+ rescue YAML::ParseException | ArgumentError | TypeCastError
+ end
+ raise YAML::ParseException.new("doesn't match any schema listed in FilterMustNot (anyOf)", 0, 0)
+ end
+
+ def to_json(builder : JSON::Builder)
+ @value.to_json(builder)
+ end
+
+ def to_yaml(builder : YAML::Nodes::Builder)
+ @value.to_yaml(builder)
+ end
+ end
+
+end
diff --git a/samples/client/others/crystal-qdrant/src/qdrant-api/models/prefetch.cr b/samples/client/others/crystal-qdrant/src/qdrant-api/models/prefetch.cr
index 8168f8c75a13..5712883bf1c6 100644
--- a/samples/client/others/crystal-qdrant/src/qdrant-api/models/prefetch.cr
+++ b/samples/client/others/crystal-qdrant/src/qdrant-api/models/prefetch.cr
@@ -15,7 +15,7 @@ module Qdrant::Api
# Optional properties
@[JSON::Field(key: "prefetch", emit_null: false)]
- property prefetch : QueryRequestPrefetch?
+ property prefetch : PrefetchPrefetch?
# Query to perform. If missing without prefetches, returns points ordered by their IDs.
@[JSON::Field(key: "query", emit_null: false)]
@@ -49,7 +49,7 @@ module Qdrant::Api
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
- def initialize(@prefetch : QueryRequestPrefetch? = nil, @query : QueryInterface? = nil, @using : String? = nil, @filter : Filter? = nil, @params : SearchParams? = nil, @score_threshold : Float32? = nil, @limit : Int32? = nil, @lookup_from : LookupLocation? = nil)
+ def initialize(@prefetch : PrefetchPrefetch? = nil, @query : QueryInterface? = nil, @using : String? = nil, @filter : Filter? = nil, @params : SearchParams? = nil, @score_threshold : Float32? = nil, @limit : Int32? = nil, @lookup_from : LookupLocation? = nil)
end
# Show invalid properties with the reasons. Usually used together with valid?
diff --git a/samples/client/others/crystal-qdrant/src/qdrant-api/models/prefetch_prefetch.cr b/samples/client/others/crystal-qdrant/src/qdrant-api/models/prefetch_prefetch.cr
new file mode 100644
index 000000000000..0158b30b5b88
--- /dev/null
+++ b/samples/client/others/crystal-qdrant/src/qdrant-api/models/prefetch_prefetch.cr
@@ -0,0 +1,71 @@
+# #Qdrant API
+#
+#The version of the OpenAPI document: master
+#Contact: andrey@vasnetsov.com
+#Generated by: https://openapi-generator.tech
+#Generator version: 7.24.0-SNAPSHOT
+#
+
+module Qdrant::Api
+ # Sub-requests to perform first. If present, the query will be performed on the results of the prefetches.
+ # PrefetchPrefetch (OpenAPI anyOf): a value matching at least one of the listed schemas.
+ # Implemented as a thin wrapper that (de)serialises by trying each member in order
+ # (the first that parses wins), so it transparently handles scalar, array and object members.
+ class PrefetchPrefetch
+ getter value
+
+ def initialize(@value : Array(Prefetch))
+ end
+ def initialize(@value : Prefetch)
+ end
+
+ # List of classes defined in anyOf (OpenAPI v3)
+ def self.openapi_any_of
+ [
+ Array(Prefetch), Prefetch
+ ]
+ end
+
+ def self.from_json(string_or_io) : self
+ from_json_any(JSON.parse(string_or_io))
+ end
+
+ def self.new(pull : JSON::PullParser)
+ from_json_any(JSON::Any.new(pull))
+ end
+
+ def self.from_json_any(data : JSON::Any) : self
+ json = data.to_json
+ begin
+ return new(Array(Prefetch).from_json(json))
+ rescue JSON::ParseException | ArgumentError | TypeCastError
+ end
+ begin
+ return new(Prefetch.from_json(json))
+ rescue JSON::ParseException | ArgumentError | TypeCastError
+ end
+ raise JSON::ParseException.new("`#{json}` doesn't match any schema listed in PrefetchPrefetch (anyOf)", 0, 0)
+ end
+
+ def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
+ begin
+ return new(Array(Prefetch).new(ctx, node))
+ rescue YAML::ParseException | ArgumentError | TypeCastError
+ end
+ begin
+ return new(Prefetch.new(ctx, node))
+ rescue YAML::ParseException | ArgumentError | TypeCastError
+ end
+ raise YAML::ParseException.new("doesn't match any schema listed in PrefetchPrefetch (anyOf)", 0, 0)
+ end
+
+ def to_json(builder : JSON::Builder)
+ @value.to_json(builder)
+ end
+
+ def to_yaml(builder : YAML::Nodes::Builder)
+ @value.to_yaml(builder)
+ end
+ end
+
+end
diff --git a/samples/client/others/crystal-qdrant/src/qdrant-api/models/tracker_status.cr b/samples/client/others/crystal-qdrant/src/qdrant-api/models/tracker_status.cr
index 2604b8883f3b..87b5f5558219 100644
--- a/samples/client/others/crystal-qdrant/src/qdrant-api/models/tracker_status.cr
+++ b/samples/client/others/crystal-qdrant/src/qdrant-api/models/tracker_status.cr
@@ -16,17 +16,17 @@ module Qdrant::Api
class TrackerStatus
getter value
- def initialize(@value : OptimizersStatusOneOf)
- end
def initialize(@value : String)
end
def initialize(@value : TrackerStatusOneOf)
end
+ def initialize(@value : TrackerStatusOneOf1)
+ end
# List of classes defined in oneOf (OpenAPI v3)
def self.openapi_one_of
[
- OptimizersStatusOneOf, String, TrackerStatusOneOf
+ String, TrackerStatusOneOf, TrackerStatusOneOf1
]
end
@@ -41,15 +41,15 @@ module Qdrant::Api
def self.from_json_any(data : JSON::Any) : self
json = data.to_json
begin
- return new(OptimizersStatusOneOf.from_json(json))
+ return new(String.from_json(json))
rescue JSON::ParseException | ArgumentError | TypeCastError
end
begin
- return new(String.from_json(json))
+ return new(TrackerStatusOneOf.from_json(json))
rescue JSON::ParseException | ArgumentError | TypeCastError
end
begin
- return new(TrackerStatusOneOf.from_json(json))
+ return new(TrackerStatusOneOf1.from_json(json))
rescue JSON::ParseException | ArgumentError | TypeCastError
end
raise JSON::ParseException.new("`#{json}` doesn't match any schema listed in TrackerStatus (oneOf)", 0, 0)
@@ -64,15 +64,15 @@ module Qdrant::Api
def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
begin
- return new(OptimizersStatusOneOf.new(ctx, node))
+ return new(String.new(ctx, node))
rescue YAML::ParseException | ArgumentError | TypeCastError
end
begin
- return new(String.new(ctx, node))
+ return new(TrackerStatusOneOf.new(ctx, node))
rescue YAML::ParseException | ArgumentError | TypeCastError
end
begin
- return new(TrackerStatusOneOf.new(ctx, node))
+ return new(TrackerStatusOneOf1.new(ctx, node))
rescue YAML::ParseException | ArgumentError | TypeCastError
end
raise YAML::ParseException.new("doesn't match any schema listed in TrackerStatus (oneOf)", 0, 0)
diff --git a/samples/client/others/crystal-qdrant/src/qdrant-api/models/tracker_status_one_of1.cr b/samples/client/others/crystal-qdrant/src/qdrant-api/models/tracker_status_one_of1.cr
new file mode 100644
index 000000000000..686aa383dd6c
--- /dev/null
+++ b/samples/client/others/crystal-qdrant/src/qdrant-api/models/tracker_status_one_of1.cr
@@ -0,0 +1,42 @@
+# #Qdrant API
+#
+#The version of the OpenAPI document: master
+#Contact: andrey@vasnetsov.com
+#Generated by: https://openapi-generator.tech
+#Generator version: 7.24.0-SNAPSHOT
+#
+
+module Qdrant::Api
+ class TrackerStatusOneOf1
+ include JSON::Serializable
+ include YAML::Serializable
+ include Qdrant::Api::Serializable
+ include Qdrant::Api::Validation
+
+ # Required properties
+ @[JSON::Field(key: "error", emit_null: false)]
+ property error : String
+
+
+ # Initializes the object
+ # @param [Hash] attributes Model attributes in the form of hash
+ def initialize(@error : String)
+ end
+
+ # Show invalid properties with the reasons. Usually used together with valid?
+ # @return Array for valid properties with the reasons
+ def list_invalid_properties
+ invalid_properties = Array(String).new
+ invalid_properties
+ end
+
+ # Check to see if the all the properties in the model are valid
+ # @return true if the model is valid
+ def valid?
+ list_invalid_properties.empty?
+ end
+
+ def_equals_and_hash(error)
+ end
+
+end
diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net10/FormModels/.openapi-generator/FILES
index cacee1eafc1b..737d53400248 100644
--- a/samples/client/petstore/csharp/generichost/net10/FormModels/.openapi-generator/FILES
+++ b/samples/client/petstore/csharp/generichost/net10/FormModels/.openapi-generator/FILES
@@ -121,6 +121,7 @@ docs/models/TestCollectionEndingWithWordList.md
docs/models/TestCollectionEndingWithWordListObject.md
docs/models/TestDescendants.md
docs/models/TestDescendantsObjectType.md
+docs/models/TestEnumParametersEnumHeaderStringParameter.md
docs/models/TestEnumParametersEnumQueryDoubleParameter.md
docs/models/TestEnumParametersEnumQueryIntegerParameter.md
docs/models/TestEnumParametersRequestEnumFormString.md
@@ -289,6 +290,7 @@ src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs
src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs
src/Org.OpenAPITools/Model/TestDescendants.cs
src/Org.OpenAPITools/Model/TestDescendantsObjectType.cs
+src/Org.OpenAPITools/Model/TestEnumParametersEnumHeaderStringParameter.cs
src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryDoubleParameter.cs
src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryIntegerParameter.cs
src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormString.cs
diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net10/FormModels/api/openapi.yaml
index 8e6e916f99eb..6dae7b5ccbd3 100644
--- a/samples/client/petstore/csharp/generichost/net10/FormModels/api/openapi.yaml
+++ b/samples/client/petstore/csharp/generichost/net10/FormModels/api/openapi.yaml
@@ -772,7 +772,7 @@ paths:
name: enum_header_string
required: false
schema:
- $ref: "#/components/schemas/testEnumParameters_request_enum_form_string"
+ $ref: "#/components/schemas/testEnumParameters_enum_header_string_parameter"
style: simple
- description: Query parameter enum test (string array)
explode: true
@@ -790,7 +790,7 @@ paths:
name: enum_query_string
required: false
schema:
- $ref: "#/components/schemas/testEnumParameters_request_enum_form_string"
+ $ref: "#/components/schemas/testEnumParameters_enum_header_string_parameter"
style: form
- description: Query parameter enum test (double)
explode: true
@@ -2819,6 +2819,13 @@ components:
enum_form_string:
$ref: "#/components/schemas/testEnumParameters_request_enum_form_string"
type: object
+ testEnumParameters_enum_header_string_parameter:
+ default: -efg
+ enum:
+ - _abc
+ - -efg
+ - (xyz)
+ type: string
testEnumParameters_enum_query_integer_parameter:
enum:
- 1
diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/docs/apis/FakeApi.md b/samples/client/petstore/csharp/generichost/net10/FormModels/docs/apis/FakeApi.md
index abf12b49fbf0..0febc3875e97 100644
--- a/samples/client/petstore/csharp/generichost/net10/FormModels/docs/apis/FakeApi.md
+++ b/samples/client/petstore/csharp/generichost/net10/FormModels/docs/apis/FakeApi.md
@@ -483,7 +483,7 @@ void (empty response body)
# **TestEnumParameters**
-> void TestEnumParameters (TestEnumParametersRequestEnumFormString enumFormString = null, List enumFormStringArray = null, TestEnumParametersRequestEnumFormString enumHeaderString = null, List enumHeaderStringArray = null, TestEnumParametersEnumQueryDoubleParameter enumQueryDouble = null, TestEnumParametersEnumQueryIntegerParameter enumQueryInteger = null, TestEnumParametersRequestEnumFormString enumQueryString = null, List enumQueryStringArray = null)
+> void TestEnumParameters (TestEnumParametersRequestEnumFormString enumFormString = null, List enumFormStringArray = null, TestEnumParametersEnumHeaderStringParameter enumHeaderString = null, List enumHeaderStringArray = null, TestEnumParametersEnumQueryDoubleParameter enumQueryDouble = null, TestEnumParametersEnumQueryIntegerParameter enumQueryInteger = null, TestEnumParametersEnumHeaderStringParameter enumQueryString = null, List enumQueryStringArray = null)
To test enum parameters
@@ -496,11 +496,11 @@ To test enum parameters
|------|------|-------------|-------|
| **enumFormString** | **TestEnumParametersRequestEnumFormString** | | [optional] |
| **enumFormStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Form parameter enum test (string array) | [optional] |
-| **enumHeaderString** | **TestEnumParametersRequestEnumFormString** | Header parameter enum test (string) | [optional] |
+| **enumHeaderString** | **TestEnumParametersEnumHeaderStringParameter** | Header parameter enum test (string) | [optional] |
| **enumHeaderStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Header parameter enum test (string array) | [optional] |
| **enumQueryDouble** | **TestEnumParametersEnumQueryDoubleParameter** | Query parameter enum test (double) | [optional] |
| **enumQueryInteger** | **TestEnumParametersEnumQueryIntegerParameter** | Query parameter enum test (double) | [optional] |
-| **enumQueryString** | **TestEnumParametersRequestEnumFormString** | Query parameter enum test (string) | [optional] |
+| **enumQueryString** | **TestEnumParametersEnumHeaderStringParameter** | Query parameter enum test (string) | [optional] |
| **enumQueryStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Query parameter enum test (string array) | [optional] |
### Return type
diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/docs/models/TestEnumParametersEnumHeaderStringParameter.md b/samples/client/petstore/csharp/generichost/net10/FormModels/docs/models/TestEnumParametersEnumHeaderStringParameter.md
new file mode 100644
index 000000000000..b5768f76fa5c
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net10/FormModels/docs/models/TestEnumParametersEnumHeaderStringParameter.md
@@ -0,0 +1,9 @@
+# Org.OpenAPITools.Model.TestEnumParametersEnumHeaderStringParameter
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
+
diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs
index 8068d40345a1..1924842cdbef 100644
--- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs
+++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs
@@ -217,11 +217,11 @@ public async Task TestEnumParametersAsyncTest()
{
Client.Option enumFormString = default;
Client.Option> enumFormStringArray = default;
- Client.Option enumHeaderString = default;
+ Client.Option enumHeaderString = default;
Client.Option> enumHeaderStringArray = default;
Client.Option enumQueryDouble = default;
Client.Option enumQueryInteger = default;
- Client.Option enumQueryString = default;
+ Client.Option enumQueryString = default;
Client.Option> enumQueryStringArray = default;
await _instance.TestEnumParametersAsync(enumFormString, enumFormStringArray, enumHeaderString, enumHeaderStringArray, enumQueryDouble, enumQueryInteger, enumQueryString, enumQueryStringArray);
}
diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumHeaderStringParameterTests.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumHeaderStringParameterTests.cs
new file mode 100644
index 000000000000..13a2e1eb54fc
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumHeaderStringParameterTests.cs
@@ -0,0 +1,56 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using Xunit;
+
+using System;
+using System.Linq;
+using System.IO;
+using System.Collections.Generic;
+using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Client;
+using System.Reflection;
+
+namespace Org.OpenAPITools.Test.Model
+{
+ ///
+ /// Class for testing TestEnumParametersEnumHeaderStringParameter
+ ///
+ ///
+ /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
+ /// Please update the test case below to test the model.
+ ///
+ public class TestEnumParametersEnumHeaderStringParameterTests : IDisposable
+ {
+ // TODO uncomment below to declare an instance variable for TestEnumParametersEnumHeaderStringParameter
+ //private TestEnumParametersEnumHeaderStringParameter instance;
+
+ public TestEnumParametersEnumHeaderStringParameterTests()
+ {
+ // TODO uncomment below to create an instance of TestEnumParametersEnumHeaderStringParameter
+ //instance = new TestEnumParametersEnumHeaderStringParameter();
+ }
+
+ public void Dispose()
+ {
+ // Cleanup when everything is done.
+ }
+
+ ///
+ /// Test an instance of TestEnumParametersEnumHeaderStringParameter
+ ///
+ [Fact]
+ public void TestEnumParametersEnumHeaderStringParameterInstanceTest()
+ {
+ // TODO uncomment below to test "IsType" TestEnumParametersEnumHeaderStringParameter
+ //Assert.IsType(instance);
+ }
+ }
+}
diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs
index 53ad97cbc3c1..6638ec4068d1 100644
--- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs
+++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs
@@ -373,7 +373,7 @@ public interface IFakeApi : IApi
/// Query parameter enum test (string array) (optional)
/// Cancellation Token to cancel the request.
/// <>
- Task TestEnumParametersAsync(Option enumFormString = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option> enumHeaderStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumQueryString = default, Option> enumQueryStringArray = default, System.Threading.CancellationToken cancellationToken = default);
+ Task TestEnumParametersAsync(Option enumFormString = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option> enumHeaderStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumQueryString = default, Option> enumQueryStringArray = default, System.Threading.CancellationToken cancellationToken = default);
///
/// To test enum parameters
@@ -391,7 +391,7 @@ public interface IFakeApi : IApi
/// Query parameter enum test (string array) (optional)
/// Cancellation Token to cancel the request.
/// <>
- Task TestEnumParametersOrDefaultAsync(Option enumFormString = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option> enumHeaderStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumQueryString = default, Option> enumQueryStringArray = default, System.Threading.CancellationToken cancellationToken = default);
+ Task TestEnumParametersOrDefaultAsync(Option enumFormString = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option> enumHeaderStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumQueryString = default, Option> enumQueryStringArray = default, System.Threading.CancellationToken cancellationToken = default);
///
/// Fake endpoint to test group parameters (optional)
@@ -4450,7 +4450,7 @@ private void OnDeserializationErrorDefaultImplementation(Exception exception, Ht
partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode);
}
- partial void FormatTestEnumParameters(ref Option enumFormString, Option> enumFormStringArray, ref Option enumHeaderString, Option> enumHeaderStringArray, ref Option enumQueryDouble, ref Option enumQueryInteger, ref Option enumQueryString, Option> enumQueryStringArray);
+ partial void FormatTestEnumParameters(ref Option enumFormString, Option> enumFormStringArray, ref Option enumHeaderString, Option> enumHeaderStringArray, ref Option enumQueryDouble, ref Option enumQueryInteger, ref Option enumQueryString, Option> enumQueryStringArray);
///
/// Validates the request parameters
@@ -4483,7 +4483,7 @@ private void ValidateTestEnumParameters(Option
///
///
- private void AfterTestEnumParametersDefaultImplementation(ITestEnumParametersApiResponse apiResponseLocalVar, Option enumFormString, Option> enumFormStringArray, Option enumHeaderString, Option> enumHeaderStringArray, Option enumQueryDouble, Option enumQueryInteger, Option enumQueryString, Option> enumQueryStringArray)
+ private void AfterTestEnumParametersDefaultImplementation(ITestEnumParametersApiResponse apiResponseLocalVar, Option enumFormString, Option> enumFormStringArray, Option enumHeaderString, Option> enumHeaderStringArray, Option enumQueryDouble, Option enumQueryInteger, Option enumQueryString, Option> enumQueryStringArray)
{
bool suppressDefaultLog = false;
AfterTestEnumParameters(ref suppressDefaultLog, apiResponseLocalVar, enumFormString, enumFormStringArray, enumHeaderString, enumHeaderStringArray, enumQueryDouble, enumQueryInteger, enumQueryString, enumQueryStringArray);
@@ -4504,7 +4504,7 @@ private void AfterTestEnumParametersDefaultImplementation(ITestEnumParametersApi
///
///
///
- partial void AfterTestEnumParameters(ref bool suppressDefaultLog, ITestEnumParametersApiResponse apiResponseLocalVar, Option enumFormString, Option> enumFormStringArray, Option enumHeaderString, Option> enumHeaderStringArray, Option enumQueryDouble, Option enumQueryInteger, Option enumQueryString, Option> enumQueryStringArray);
+ partial void AfterTestEnumParameters(ref bool suppressDefaultLog, ITestEnumParametersApiResponse apiResponseLocalVar, Option enumFormString, Option> enumFormStringArray, Option enumHeaderString, Option> enumHeaderStringArray, Option enumQueryDouble, Option enumQueryInteger, Option enumQueryString, Option> enumQueryStringArray);
///
/// Logs exceptions that occur while retrieving the server response
@@ -4520,7 +4520,7 @@ private void AfterTestEnumParametersDefaultImplementation(ITestEnumParametersApi
///
///
///
- private void OnErrorTestEnumParametersDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, Option enumFormString, Option> enumFormStringArray, Option enumHeaderString, Option> enumHeaderStringArray, Option enumQueryDouble, Option enumQueryInteger, Option enumQueryString, Option> enumQueryStringArray)
+ private void OnErrorTestEnumParametersDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, Option enumFormString, Option> enumFormStringArray, Option enumHeaderString, Option> enumHeaderStringArray, Option enumQueryDouble, Option enumQueryInteger, Option enumQueryString, Option> enumQueryStringArray)
{
bool suppressDefaultLogLocalVar = false;
OnErrorTestEnumParameters(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, enumFormString, enumFormStringArray, enumHeaderString, enumHeaderStringArray, enumQueryDouble, enumQueryInteger, enumQueryString, enumQueryStringArray);
@@ -4543,7 +4543,7 @@ private void OnErrorTestEnumParametersDefaultImplementation(Exception exceptionL
///
///
///
- partial void OnErrorTestEnumParameters(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, Option enumFormString, Option> enumFormStringArray, Option enumHeaderString, Option> enumHeaderStringArray, Option enumQueryDouble, Option enumQueryInteger, Option enumQueryString, Option> enumQueryStringArray);
+ partial void OnErrorTestEnumParameters(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, Option enumFormString, Option> enumFormStringArray, Option enumHeaderString, Option> enumHeaderStringArray, Option enumQueryDouble, Option enumQueryInteger, Option enumQueryString, Option> enumQueryStringArray);
///
/// To test enum parameters To test enum parameters
@@ -4558,7 +4558,7 @@ private void OnErrorTestEnumParametersDefaultImplementation(Exception exceptionL
/// Query parameter enum test (string array) (optional)
/// Cancellation Token to cancel the request.
/// <>
- public async Task TestEnumParametersOrDefaultAsync(Option enumFormString = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option> enumHeaderStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumQueryString = default, Option> enumQueryStringArray = default, System.Threading.CancellationToken cancellationToken = default)
+ public async Task TestEnumParametersOrDefaultAsync(Option enumFormString = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option> enumHeaderStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumQueryString = default, Option> enumQueryStringArray = default, System.Threading.CancellationToken cancellationToken = default)
{
try
{
@@ -4584,7 +4584,7 @@ public async Task TestEnumParametersOrDefaultAsy
/// Query parameter enum test (string array) (optional)
/// Cancellation Token to cancel the request.
/// <>
- public async Task TestEnumParametersAsync(Option enumFormString = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option> enumHeaderStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumQueryString = default, Option> enumQueryStringArray = default, System.Threading.CancellationToken cancellationToken = default)
+ public async Task TestEnumParametersAsync(Option enumFormString = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option> enumHeaderStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumQueryString = default, Option> enumQueryStringArray = default, System.Threading.CancellationToken cancellationToken = default)
{
UriBuilder uriBuilderLocalVar = new UriBuilder();
diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/ClientUtils.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/ClientUtils.cs
index df3b3537a120..be99808e8e53 100644
--- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/ClientUtils.cs
+++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/ClientUtils.cs
@@ -204,6 +204,8 @@ public static string ParameterToString(object obj, string format = ISO8601_DATET
return RequiredClassRequiredNullableEnumStringValueConverter.ToJsonValue(requiredClassRequiredNullableEnumString);
if (obj is TestDescendantsObjectType testDescendantsObjectType)
return TestDescendantsObjectTypeValueConverter.ToJsonValue(testDescendantsObjectType);
+ if (obj is TestEnumParametersEnumHeaderStringParameter testEnumParametersEnumHeaderStringParameter)
+ return TestEnumParametersEnumHeaderStringParameterValueConverter.ToJsonValue(testEnumParametersEnumHeaderStringParameter);
if (obj is TestEnumParametersEnumQueryDoubleParameter testEnumParametersEnumQueryDoubleParameter)
return TestEnumParametersEnumQueryDoubleParameterValueConverter.ToJsonValue(testEnumParametersEnumQueryDoubleParameter).ToString();
if (obj is TestEnumParametersEnumQueryIntegerParameter testEnumParametersEnumQueryIntegerParameter)
diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/HostConfiguration.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/HostConfiguration.cs
index 86e57f6fc333..570f9f5f10fe 100644
--- a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/HostConfiguration.cs
+++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Client/HostConfiguration.cs
@@ -176,6 +176,8 @@ public HostConfiguration(IServiceCollection services)
_jsonOptions.Converters.Add(new TestDescendantsJsonConverter());
_jsonOptions.Converters.Add(new TestDescendantsObjectTypeJsonConverter());
_jsonOptions.Converters.Add(new TestDescendantsObjectTypeNullableJsonConverter());
+ _jsonOptions.Converters.Add(new TestEnumParametersEnumHeaderStringParameterJsonConverter());
+ _jsonOptions.Converters.Add(new TestEnumParametersEnumHeaderStringParameterNullableJsonConverter());
_jsonOptions.Converters.Add(new TestEnumParametersEnumQueryDoubleParameterJsonConverter());
_jsonOptions.Converters.Add(new TestEnumParametersEnumQueryDoubleParameterNullableJsonConverter());
_jsonOptions.Converters.Add(new TestEnumParametersEnumQueryIntegerParameterJsonConverter());
diff --git a/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumHeaderStringParameter.cs b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumHeaderStringParameter.cs
new file mode 100644
index 000000000000..4fe8d2deb709
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net10/FormModels/src/Org.OpenAPITools/Model/TestEnumParametersEnumHeaderStringParameter.cs
@@ -0,0 +1,188 @@
+//
+/*
+ * OpenAPI Petstore
+ *
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using System.ComponentModel.DataAnnotations;
+using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
+using Org.OpenAPITools.Client;
+
+namespace Org.OpenAPITools.Model
+{
+ ///
+ /// Defines testEnumParameters_enum_header_string_parameter
+ ///
+ public enum TestEnumParametersEnumHeaderStringParameter
+ {
+ ///
+ /// Enum Abc for value: _abc
+ ///
+ Abc = 1,
+
+ ///
+ /// Enum Efg for value: -efg
+ ///
+ Efg = 2,
+
+ ///
+ /// Enum Xyz for value: (xyz)
+ ///
+ Xyz = 3
+ }
+
+ ///
+ /// Converts to and from the JSON value
+ ///
+ public static class TestEnumParametersEnumHeaderStringParameterValueConverter
+ {
+ ///
+ /// Parses a given value to
+ ///
+ ///
+ ///
+ public static TestEnumParametersEnumHeaderStringParameter FromString(string value)
+ {
+ if (value.Equals("_abc"))
+ return TestEnumParametersEnumHeaderStringParameter.Abc;
+
+ if (value.Equals("-efg"))
+ return TestEnumParametersEnumHeaderStringParameter.Efg;
+
+ if (value.Equals("(xyz)"))
+ return TestEnumParametersEnumHeaderStringParameter.Xyz;
+
+ throw new NotImplementedException($"Could not convert value to type TestEnumParametersEnumHeaderStringParameter: '{value}'");
+ }
+
+ ///
+ /// Parses a given value to
+ ///
+ ///
+ ///
+ public static TestEnumParametersEnumHeaderStringParameter? FromStringOrDefault(string value)
+ {
+ if (value.Equals("_abc"))
+ return TestEnumParametersEnumHeaderStringParameter.Abc;
+
+ if (value.Equals("-efg"))
+ return TestEnumParametersEnumHeaderStringParameter.Efg;
+
+ if (value.Equals("(xyz)"))
+ return TestEnumParametersEnumHeaderStringParameter.Xyz;
+
+ return null;
+ }
+
+ ///
+ /// Converts the to the json value
+ ///
+ ///
+ ///
+ ///
+ public static string ToJsonValue(TestEnumParametersEnumHeaderStringParameter value)
+ {
+ if (value == TestEnumParametersEnumHeaderStringParameter.Abc)
+ return "_abc";
+
+ if (value == TestEnumParametersEnumHeaderStringParameter.Efg)
+ return "-efg";
+
+ if (value == TestEnumParametersEnumHeaderStringParameter.Xyz)
+ return "(xyz)";
+
+ throw new NotImplementedException($"Value could not be handled: '{value}'");
+ }
+ }
+
+ ///
+ /// A Json converter for type
+ ///
+ ///
+ public class TestEnumParametersEnumHeaderStringParameterJsonConverter : JsonConverter
+ {
+ ///
+ /// Returns a from the Json object
+ ///
+ ///
+ ///
+ ///
+ ///
+ public override TestEnumParametersEnumHeaderStringParameter Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ string rawValue = reader.GetString();
+
+ TestEnumParametersEnumHeaderStringParameter? result = rawValue == null
+ ? null
+ : TestEnumParametersEnumHeaderStringParameterValueConverter.FromStringOrDefault(rawValue);
+
+ if (result != null)
+ return result.Value;
+
+ throw new JsonException();
+ }
+
+ ///
+ /// Writes the TestEnumParametersEnumHeaderStringParameter to the json writer
+ ///
+ ///
+ ///
+ ///
+ public override void Write(Utf8JsonWriter writer, TestEnumParametersEnumHeaderStringParameter testEnumParametersEnumHeaderStringParameter, JsonSerializerOptions options)
+ {
+ writer.WriteStringValue(TestEnumParametersEnumHeaderStringParameterValueConverter.ToJsonValue(testEnumParametersEnumHeaderStringParameter).ToString());
+ }
+ }
+
+ ///
+ /// A Json converter for type
+ ///
+ public class TestEnumParametersEnumHeaderStringParameterNullableJsonConverter : JsonConverter
+ {
+ ///
+ /// Returns a TestEnumParametersEnumHeaderStringParameter from the Json object
+ ///
+ ///
+ ///
+ ///
+ ///
+ public override TestEnumParametersEnumHeaderStringParameter? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
+ {
+ string rawValue = reader.GetString();
+
+ TestEnumParametersEnumHeaderStringParameter? result = rawValue == null
+ ? null
+ : TestEnumParametersEnumHeaderStringParameterValueConverter.FromStringOrDefault(rawValue);
+
+ if (result != null)
+ return result.Value;
+
+ throw new JsonException();
+ }
+
+ ///
+ /// Writes the TestEnumParametersEnumHeaderStringParameter to the json writer
+ ///
+ ///
+ ///
+ ///
+ public override void Write(Utf8JsonWriter writer, TestEnumParametersEnumHeaderStringParameter? testEnumParametersEnumHeaderStringParameter, JsonSerializerOptions options)
+ {
+ writer.WriteStringValue(testEnumParametersEnumHeaderStringParameter.HasValue ? TestEnumParametersEnumHeaderStringParameterValueConverter.ToJsonValue(testEnumParametersEnumHeaderStringParameter.Value).ToString() : "null");
+ }
+ }
+}
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/net4.7/FormModels/.openapi-generator/FILES
index 905ec3b8592d..4d9b3d8248d3 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/.openapi-generator/FILES
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/.openapi-generator/FILES
@@ -121,6 +121,7 @@ docs/models/TestCollectionEndingWithWordList.md
docs/models/TestCollectionEndingWithWordListObject.md
docs/models/TestDescendants.md
docs/models/TestDescendantsObjectType.md
+docs/models/TestEnumParametersEnumHeaderStringParameter.md
docs/models/TestEnumParametersEnumQueryDoubleParameter.md
docs/models/TestEnumParametersEnumQueryIntegerParameter.md
docs/models/TestEnumParametersRequestEnumFormString.md
@@ -287,6 +288,7 @@ src/Org.OpenAPITools/Model/TestCollectionEndingWithWordList.cs
src/Org.OpenAPITools/Model/TestCollectionEndingWithWordListObject.cs
src/Org.OpenAPITools/Model/TestDescendants.cs
src/Org.OpenAPITools/Model/TestDescendantsObjectType.cs
+src/Org.OpenAPITools/Model/TestEnumParametersEnumHeaderStringParameter.cs
src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryDoubleParameter.cs
src/Org.OpenAPITools/Model/TestEnumParametersEnumQueryIntegerParameter.cs
src/Org.OpenAPITools/Model/TestEnumParametersRequestEnumFormString.cs
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.7/FormModels/api/openapi.yaml
index 8e6e916f99eb..6dae7b5ccbd3 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/api/openapi.yaml
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/api/openapi.yaml
@@ -772,7 +772,7 @@ paths:
name: enum_header_string
required: false
schema:
- $ref: "#/components/schemas/testEnumParameters_request_enum_form_string"
+ $ref: "#/components/schemas/testEnumParameters_enum_header_string_parameter"
style: simple
- description: Query parameter enum test (string array)
explode: true
@@ -790,7 +790,7 @@ paths:
name: enum_query_string
required: false
schema:
- $ref: "#/components/schemas/testEnumParameters_request_enum_form_string"
+ $ref: "#/components/schemas/testEnumParameters_enum_header_string_parameter"
style: form
- description: Query parameter enum test (double)
explode: true
@@ -2819,6 +2819,13 @@ components:
enum_form_string:
$ref: "#/components/schemas/testEnumParameters_request_enum_form_string"
type: object
+ testEnumParameters_enum_header_string_parameter:
+ default: -efg
+ enum:
+ - _abc
+ - -efg
+ - (xyz)
+ type: string
testEnumParameters_enum_query_integer_parameter:
enum:
- 1
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeApi.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeApi.md
index 1a41e359c74e..408b1fc495ae 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeApi.md
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/apis/FakeApi.md
@@ -483,7 +483,7 @@ void (empty response body)
# **TestEnumParameters**
-> void TestEnumParameters (TestEnumParametersRequestEnumFormString enumFormString = null, List enumFormStringArray = null, TestEnumParametersRequestEnumFormString enumHeaderString = null, List enumHeaderStringArray = null, TestEnumParametersEnumQueryDoubleParameter enumQueryDouble = null, TestEnumParametersEnumQueryIntegerParameter enumQueryInteger = null, TestEnumParametersRequestEnumFormString enumQueryString = null, List enumQueryStringArray = null)
+> void TestEnumParameters (TestEnumParametersRequestEnumFormString enumFormString = null, List enumFormStringArray = null, TestEnumParametersEnumHeaderStringParameter enumHeaderString = null, List enumHeaderStringArray = null, TestEnumParametersEnumQueryDoubleParameter enumQueryDouble = null, TestEnumParametersEnumQueryIntegerParameter enumQueryInteger = null, TestEnumParametersEnumHeaderStringParameter enumQueryString = null, List enumQueryStringArray = null)
To test enum parameters
@@ -496,11 +496,11 @@ To test enum parameters
|------|------|-------------|-------|
| **enumFormString** | **TestEnumParametersRequestEnumFormString** | | [optional] |
| **enumFormStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Form parameter enum test (string array) | [optional] |
-| **enumHeaderString** | **TestEnumParametersRequestEnumFormString** | Header parameter enum test (string) | [optional] |
+| **enumHeaderString** | **TestEnumParametersEnumHeaderStringParameter** | Header parameter enum test (string) | [optional] |
| **enumHeaderStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Header parameter enum test (string array) | [optional] |
| **enumQueryDouble** | **TestEnumParametersEnumQueryDoubleParameter** | Query parameter enum test (double) | [optional] |
| **enumQueryInteger** | **TestEnumParametersEnumQueryIntegerParameter** | Query parameter enum test (double) | [optional] |
-| **enumQueryString** | **TestEnumParametersRequestEnumFormString** | Query parameter enum test (string) | [optional] |
+| **enumQueryString** | **TestEnumParametersEnumHeaderStringParameter** | Query parameter enum test (string) | [optional] |
| **enumQueryStringArray** | [**List<TestEnumParametersRequestEnumFormStringArrayInner>**](TestEnumParametersRequestEnumFormStringArrayInner.md) | Query parameter enum test (string array) | [optional] |
### Return type
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestEnumParametersEnumHeaderStringParameter.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestEnumParametersEnumHeaderStringParameter.md
new file mode 100644
index 000000000000..b5768f76fa5c
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/TestEnumParametersEnumHeaderStringParameter.md
@@ -0,0 +1,9 @@
+# Org.OpenAPITools.Model.TestEnumParametersEnumHeaderStringParameter
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
+
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs
index 12cea017ba96..62c158ea45da 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs
@@ -217,11 +217,11 @@ public async Task TestEnumParametersAsyncTest()
{
Client.Option enumFormString = default;
Client.Option> enumFormStringArray = default;
- Client.Option enumHeaderString = default;
+ Client.Option enumHeaderString = default;
Client.Option> enumHeaderStringArray = default;
Client.Option enumQueryDouble = default;
Client.Option enumQueryInteger = default;
- Client.Option enumQueryString = default;
+ Client.Option enumQueryString = default;
Client.Option> enumQueryStringArray = default;
await _instance.TestEnumParametersAsync(enumFormString, enumFormStringArray, enumHeaderString, enumHeaderStringArray, enumQueryDouble, enumQueryInteger, enumQueryString, enumQueryStringArray);
}
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumHeaderStringParameterTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumHeaderStringParameterTests.cs
new file mode 100644
index 000000000000..13a2e1eb54fc
--- /dev/null
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/TestEnumParametersEnumHeaderStringParameterTests.cs
@@ -0,0 +1,56 @@
+/*
+ * OpenAPI Petstore
+ *
+ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using Xunit;
+
+using System;
+using System.Linq;
+using System.IO;
+using System.Collections.Generic;
+using Org.OpenAPITools.Model;
+using Org.OpenAPITools.Client;
+using System.Reflection;
+
+namespace Org.OpenAPITools.Test.Model
+{
+ ///
+ /// Class for testing TestEnumParametersEnumHeaderStringParameter
+ ///
+ ///
+ /// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
+ /// Please update the test case below to test the model.
+ ///
+ public class TestEnumParametersEnumHeaderStringParameterTests : IDisposable
+ {
+ // TODO uncomment below to declare an instance variable for TestEnumParametersEnumHeaderStringParameter
+ //private TestEnumParametersEnumHeaderStringParameter instance;
+
+ public TestEnumParametersEnumHeaderStringParameterTests()
+ {
+ // TODO uncomment below to create an instance of TestEnumParametersEnumHeaderStringParameter
+ //instance = new TestEnumParametersEnumHeaderStringParameter();
+ }
+
+ public void Dispose()
+ {
+ // Cleanup when everything is done.
+ }
+
+ ///
+ /// Test an instance of TestEnumParametersEnumHeaderStringParameter
+ ///
+ [Fact]
+ public void TestEnumParametersEnumHeaderStringParameterInstanceTest()
+ {
+ // TODO uncomment below to test "IsType" TestEnumParametersEnumHeaderStringParameter
+ //Assert.IsType(instance);
+ }
+ }
+}
diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs
index 3f5b3258a5b3..e978aa8b5292 100644
--- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs
+++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs
@@ -373,7 +373,7 @@ public interface IFakeApi : IApi
/// Query parameter enum test (string array) (optional)
/// Cancellation Token to cancel the request.
/// <>
- Task TestEnumParametersAsync(Option enumFormString = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option> enumHeaderStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumQueryString = default, Option> enumQueryStringArray = default, System.Threading.CancellationToken cancellationToken = default);
+ Task TestEnumParametersAsync(Option enumFormString = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option> enumHeaderStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumQueryString = default, Option> enumQueryStringArray = default, System.Threading.CancellationToken cancellationToken = default);
///
/// To test enum parameters
@@ -391,7 +391,7 @@ public interface IFakeApi : IApi
/// Query parameter enum test (string array) (optional)
/// Cancellation Token to cancel the request.
/// <>
- Task TestEnumParametersOrDefaultAsync(Option enumFormString = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option> enumHeaderStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumQueryString = default, Option> enumQueryStringArray = default, System.Threading.CancellationToken cancellationToken = default);
+ Task TestEnumParametersOrDefaultAsync(Option enumFormString = default, Option> enumFormStringArray = default, Option enumHeaderString = default, Option> enumHeaderStringArray = default, Option enumQueryDouble = default, Option enumQueryInteger = default, Option enumQueryString = default, Option> enumQueryStringArray = default, System.Threading.CancellationToken cancellationToken = default);
///
/// Fake endpoint to test group parameters (optional)
@@ -4441,7 +4441,7 @@ private void OnDeserializationErrorDefaultImplementation(Exception exception, Ht
partial void OnDeserializationError(ref bool suppressDefaultLog, Exception exception, HttpStatusCode httpStatusCode);
}
- partial void FormatTestEnumParameters(ref Option enumFormString, Option> enumFormStringArray, ref Option enumHeaderString, Option> enumHeaderStringArray, ref Option enumQueryDouble, ref Option enumQueryInteger, ref Option enumQueryString, Option> enumQueryStringArray);
+ partial void FormatTestEnumParameters(ref Option enumFormString, Option> enumFormStringArray, ref Option enumHeaderString, Option> enumHeaderStringArray, ref Option enumQueryDouble, ref Option enumQueryInteger, ref Option enumQueryString, Option> enumQueryStringArray);
///
/// Validates the request parameters
@@ -4474,7 +4474,7 @@ private void ValidateTestEnumParameters(Option
///
///
- private void AfterTestEnumParametersDefaultImplementation(ITestEnumParametersApiResponse apiResponseLocalVar, Option enumFormString, Option> enumFormStringArray, Option