From bd2fbee00931416b29d3854777aa0e247ceaadf4 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Mon, 31 Mar 2025 12:04:48 +0200 Subject: [PATCH 1/2] [Swift6] Remove QueryStringEncodable for models --- docs/generators/swift6.md | 1 - .../languages/Swift6ClientCodegen.java | 12 ---- .../main/resources/swift6/APIHelper.mustache | 21 +----- .../main/resources/swift6/Extensions.mustache | 66 ++----------------- .../src/main/resources/swift6/Models.mustache | 2 +- .../swift6/OpenAPIDateWithoutTime.mustache | 2 +- .../src/main/resources/swift6/api.mustache | 3 +- .../main/resources/swift6/modelEnum.mustache | 2 +- .../modelInlineEnumDeclaration.mustache | 2 +- .../resources/swift6/modelObject.mustache | 4 +- .../main/resources/swift6/modelOneOf.mustache | 2 +- .../Swift6ClientCodegenOptionsProvider.java | 2 - .../Sources/PetstoreClient/APIs/FakeAPI.swift | 9 +-- .../Sources/PetstoreClient/APIs/PetAPI.swift | 9 +-- .../Infrastructure/APIHelper.swift | 21 +----- .../Infrastructure/Extensions.swift | 66 ++----------------- .../Infrastructure/Models.swift | 2 +- .../OpenAPIDateWithoutTime.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../PetstoreClient/Models/Animal.swift | 2 +- .../PetstoreClient/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../Models/ArrayOfNumberOnly.swift | 2 +- .../PetstoreClient/Models/ArrayTest.swift | 2 +- .../Models/Capitalization.swift | 2 +- .../Sources/PetstoreClient/Models/Cat.swift | 2 +- .../PetstoreClient/Models/Category.swift | 2 +- .../PetstoreClient/Models/ClassModel.swift | 2 +- .../PetstoreClient/Models/Client.swift | 2 +- .../Sources/PetstoreClient/Models/Dog.swift | 2 +- .../PetstoreClient/Models/EnumArrays.swift | 6 +- .../PetstoreClient/Models/EnumClass.swift | 2 +- .../PetstoreClient/Models/EnumTest.swift | 10 +-- .../Sources/PetstoreClient/Models/File.swift | 2 +- .../Models/FileSchemaTestClass.swift | 2 +- .../PetstoreClient/Models/FormatTest.swift | 2 +- .../Models/HasOnlyReadOnly.swift | 2 +- .../Sources/PetstoreClient/Models/List.swift | 2 +- .../PetstoreClient/Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../Models/Model200Response.swift | 2 +- .../Sources/PetstoreClient/Models/Name.swift | 2 +- .../PetstoreClient/Models/NumberOnly.swift | 2 +- .../Sources/PetstoreClient/Models/Order.swift | 4 +- .../Models/OuterComposite.swift | 2 +- .../PetstoreClient/Models/OuterEnum.swift | 2 +- .../Sources/PetstoreClient/Models/Pet.swift | 4 +- .../PetstoreClient/Models/ReadOnlyFirst.swift | 2 +- .../PetstoreClient/Models/Return.swift | 2 +- .../Models/SpecialModelName.swift | 2 +- .../Models/StringBooleanMap.swift | 2 +- .../Sources/PetstoreClient/Models/Tag.swift | 2 +- .../Models/TypeHolderDefault.swift | 2 +- .../Models/TypeHolderExample.swift | 2 +- .../Sources/PetstoreClient/Models/User.swift | 2 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 9 +-- .../Sources/PetstoreClient/APIs/PetAPI.swift | 9 +-- .../Infrastructure/APIHelper.swift | 21 +----- .../Infrastructure/Extensions.swift | 66 ++----------------- .../Infrastructure/Models.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../PetstoreClient/Models/Animal.swift | 2 +- .../PetstoreClient/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../Models/ArrayOfNumberOnly.swift | 2 +- .../PetstoreClient/Models/ArrayTest.swift | 2 +- .../Models/Capitalization.swift | 2 +- .../Sources/PetstoreClient/Models/Cat.swift | 2 +- .../PetstoreClient/Models/Category.swift | 2 +- .../PetstoreClient/Models/ClassModel.swift | 2 +- .../PetstoreClient/Models/Client.swift | 2 +- .../Sources/PetstoreClient/Models/Dog.swift | 2 +- .../PetstoreClient/Models/EnumArrays.swift | 6 +- .../PetstoreClient/Models/EnumClass.swift | 2 +- .../PetstoreClient/Models/EnumTest.swift | 10 +-- .../Sources/PetstoreClient/Models/File.swift | 2 +- .../Models/FileSchemaTestClass.swift | 2 +- .../PetstoreClient/Models/FormatTest.swift | 2 +- .../Models/HasOnlyReadOnly.swift | 2 +- .../Sources/PetstoreClient/Models/List.swift | 2 +- .../PetstoreClient/Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../Models/Model200Response.swift | 2 +- .../Sources/PetstoreClient/Models/Name.swift | 2 +- .../PetstoreClient/Models/NumberOnly.swift | 2 +- .../Sources/PetstoreClient/Models/Order.swift | 4 +- .../Models/OuterComposite.swift | 2 +- .../PetstoreClient/Models/OuterEnum.swift | 2 +- .../Sources/PetstoreClient/Models/Pet.swift | 4 +- .../PetstoreClient/Models/ReadOnlyFirst.swift | 2 +- .../PetstoreClient/Models/Return.swift | 2 +- .../Models/SpecialModelName.swift | 2 +- .../Sources/PetstoreClient/Models/Tag.swift | 2 +- .../Models/TypeHolderDefault.swift | 2 +- .../Models/TypeHolderExample.swift | 2 +- .../Sources/PetstoreClient/Models/User.swift | 2 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 9 +-- .../Sources/PetstoreClient/APIs/PetAPI.swift | 9 +-- .../Infrastructure/APIHelper.swift | 21 +----- .../Infrastructure/Extensions.swift | 66 ++----------------- .../Infrastructure/Models.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../PetstoreClient/Models/Animal.swift | 2 +- .../PetstoreClient/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../Models/ArrayOfNumberOnly.swift | 2 +- .../PetstoreClient/Models/ArrayTest.swift | 2 +- .../Models/Capitalization.swift | 2 +- .../Sources/PetstoreClient/Models/Cat.swift | 2 +- .../PetstoreClient/Models/Category.swift | 2 +- .../PetstoreClient/Models/ClassModel.swift | 2 +- .../PetstoreClient/Models/Client.swift | 2 +- .../Sources/PetstoreClient/Models/Dog.swift | 2 +- .../PetstoreClient/Models/EnumArrays.swift | 6 +- .../PetstoreClient/Models/EnumClass.swift | 2 +- .../PetstoreClient/Models/EnumTest.swift | 10 +-- .../Sources/PetstoreClient/Models/File.swift | 2 +- .../Models/FileSchemaTestClass.swift | 2 +- .../PetstoreClient/Models/FormatTest.swift | 2 +- .../Models/HasOnlyReadOnly.swift | 2 +- .../Sources/PetstoreClient/Models/List.swift | 2 +- .../PetstoreClient/Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../Models/Model200Response.swift | 2 +- .../Sources/PetstoreClient/Models/Name.swift | 2 +- .../PetstoreClient/Models/NumberOnly.swift | 2 +- .../Sources/PetstoreClient/Models/Order.swift | 4 +- .../Models/OuterComposite.swift | 2 +- .../PetstoreClient/Models/OuterEnum.swift | 2 +- .../Sources/PetstoreClient/Models/Pet.swift | 4 +- .../PetstoreClient/Models/ReadOnlyFirst.swift | 2 +- .../PetstoreClient/Models/Return.swift | 2 +- .../Models/SpecialModelName.swift | 2 +- .../Models/StringBooleanMap.swift | 2 +- .../Sources/PetstoreClient/Models/Tag.swift | 2 +- .../Models/TypeHolderDefault.swift | 2 +- .../Models/TypeHolderExample.swift | 2 +- .../Sources/PetstoreClient/Models/User.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 9 +-- .../Classes/OpenAPIs/APIs/PetAPI.swift | 9 +-- .../OpenAPIs/Infrastructure/APIHelper.swift | 21 +----- .../OpenAPIs/Infrastructure/Extensions.swift | 66 ++----------------- .../OpenAPIs/Infrastructure/Models.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 10 +-- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Sources/CombineLibrary/APIs/FakeAPI.swift | 9 +-- .../Sources/CombineLibrary/APIs/PetAPI.swift | 9 +-- .../Infrastructure/APIHelper.swift | 21 +----- .../Infrastructure/Extensions.swift | 66 ++----------------- .../Infrastructure/Models.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../CombineLibrary/Models/Animal.swift | 2 +- .../CombineLibrary/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../Models/ArrayOfNumberOnly.swift | 2 +- .../CombineLibrary/Models/ArrayTest.swift | 2 +- .../Models/Capitalization.swift | 2 +- .../Sources/CombineLibrary/Models/Cat.swift | 2 +- .../CombineLibrary/Models/Category.swift | 2 +- .../CombineLibrary/Models/ClassModel.swift | 2 +- .../CombineLibrary/Models/Client.swift | 2 +- .../Sources/CombineLibrary/Models/Dog.swift | 2 +- .../CombineLibrary/Models/EnumArrays.swift | 6 +- .../CombineLibrary/Models/EnumClass.swift | 2 +- .../CombineLibrary/Models/EnumTest.swift | 10 +-- .../Sources/CombineLibrary/Models/File.swift | 2 +- .../Models/FileSchemaTestClass.swift | 2 +- .../CombineLibrary/Models/FormatTest.swift | 2 +- .../Models/HasOnlyReadOnly.swift | 2 +- .../Sources/CombineLibrary/Models/List.swift | 2 +- .../CombineLibrary/Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../Models/Model200Response.swift | 2 +- .../Sources/CombineLibrary/Models/Name.swift | 2 +- .../CombineLibrary/Models/NumberOnly.swift | 2 +- .../Sources/CombineLibrary/Models/Order.swift | 4 +- .../Models/OuterComposite.swift | 2 +- .../CombineLibrary/Models/OuterEnum.swift | 2 +- .../Sources/CombineLibrary/Models/Pet.swift | 4 +- .../CombineLibrary/Models/ReadOnlyFirst.swift | 2 +- .../CombineLibrary/Models/Return.swift | 2 +- .../Models/SpecialModelName.swift | 2 +- .../Models/StringBooleanMap.swift | 2 +- .../Sources/CombineLibrary/Models/Tag.swift | 2 +- .../Models/TypeHolderDefault.swift | 2 +- .../Models/TypeHolderExample.swift | 2 +- .../Sources/CombineLibrary/Models/User.swift | 2 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 9 +-- .../Sources/PetstoreClient/APIs/PetAPI.swift | 9 +-- .../Infrastructure/APIHelper.swift | 21 +----- .../Infrastructure/Extensions.swift | 66 ++----------------- .../Infrastructure/Models.swift | 2 +- .../Models/AdditionalPropertiesAnyType.swift | 2 +- .../Models/AdditionalPropertiesArray.swift | 2 +- .../Models/AdditionalPropertiesBoolean.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Models/AdditionalPropertiesInteger.swift | 2 +- .../Models/AdditionalPropertiesNumber.swift | 2 +- .../Models/AdditionalPropertiesObject.swift | 2 +- .../Models/AdditionalPropertiesString.swift | 2 +- .../PetstoreClient/Models/Animal.swift | 2 +- .../PetstoreClient/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../Models/ArrayOfNumberOnly.swift | 2 +- .../PetstoreClient/Models/ArrayTest.swift | 2 +- .../PetstoreClient/Models/BigCat.swift | 4 +- .../Models/Capitalization.swift | 2 +- .../Sources/PetstoreClient/Models/Cat.swift | 2 +- .../PetstoreClient/Models/Category.swift | 2 +- .../PetstoreClient/Models/ClassModel.swift | 2 +- .../PetstoreClient/Models/Client.swift | 2 +- .../Sources/PetstoreClient/Models/Dog.swift | 2 +- .../PetstoreClient/Models/EnumArrays.swift | 6 +- .../PetstoreClient/Models/EnumClass.swift | 2 +- .../PetstoreClient/Models/EnumTest.swift | 10 +-- .../Sources/PetstoreClient/Models/File.swift | 2 +- .../Models/FileSchemaTestClass.swift | 2 +- .../PetstoreClient/Models/FormatTest.swift | 2 +- .../Models/HasOnlyReadOnly.swift | 2 +- .../Sources/PetstoreClient/Models/List.swift | 2 +- .../PetstoreClient/Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../Models/Model200Response.swift | 2 +- .../Sources/PetstoreClient/Models/Name.swift | 2 +- .../PetstoreClient/Models/NumberOnly.swift | 2 +- .../Sources/PetstoreClient/Models/Order.swift | 4 +- .../Models/OuterComposite.swift | 2 +- .../PetstoreClient/Models/OuterEnum.swift | 2 +- .../Sources/PetstoreClient/Models/Pet.swift | 4 +- .../PetstoreClient/Models/ReadOnlyFirst.swift | 2 +- .../PetstoreClient/Models/Return.swift | 2 +- .../Models/SpecialModelName.swift | 2 +- .../Models/StringBooleanMap.swift | 2 +- .../Sources/PetstoreClient/Models/Tag.swift | 2 +- .../Models/TypeHolderDefault.swift | 2 +- .../Models/TypeHolderExample.swift | 2 +- .../Sources/PetstoreClient/Models/User.swift | 2 +- .../PetstoreClient/Models/XmlItem.swift | 2 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 9 +-- .../Sources/PetstoreClient/APIs/PetAPI.swift | 9 +-- .../Infrastructure/APIHelper.swift | 21 +----- .../Infrastructure/Extensions.swift | 66 ++----------------- .../Infrastructure/Models.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../PetstoreClient/Models/Animal.swift | 2 +- .../PetstoreClient/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../Models/ArrayOfNumberOnly.swift | 2 +- .../PetstoreClient/Models/ArrayTest.swift | 2 +- .../Models/Capitalization.swift | 2 +- .../Sources/PetstoreClient/Models/Cat.swift | 2 +- .../PetstoreClient/Models/Category.swift | 2 +- .../PetstoreClient/Models/ClassModel.swift | 2 +- .../PetstoreClient/Models/Client.swift | 2 +- .../Sources/PetstoreClient/Models/Dog.swift | 2 +- .../PetstoreClient/Models/EnumArrays.swift | 6 +- .../PetstoreClient/Models/EnumClass.swift | 2 +- .../PetstoreClient/Models/EnumTest.swift | 10 +-- .../Sources/PetstoreClient/Models/File.swift | 2 +- .../Models/FileSchemaTestClass.swift | 2 +- .../PetstoreClient/Models/FormatTest.swift | 2 +- .../Models/HasOnlyReadOnly.swift | 2 +- .../Sources/PetstoreClient/Models/List.swift | 2 +- .../PetstoreClient/Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../Models/Model200Response.swift | 2 +- .../Sources/PetstoreClient/Models/Name.swift | 2 +- .../PetstoreClient/Models/NumberOnly.swift | 2 +- .../Sources/PetstoreClient/Models/Order.swift | 4 +- .../Models/OuterComposite.swift | 2 +- .../PetstoreClient/Models/OuterEnum.swift | 2 +- .../Sources/PetstoreClient/Models/Pet.swift | 4 +- .../PetstoreClient/Models/ReadOnlyFirst.swift | 2 +- .../PetstoreClient/Models/Return.swift | 2 +- .../Models/SpecialModelName.swift | 2 +- .../Models/StringBooleanMap.swift | 2 +- .../Sources/PetstoreClient/Models/Tag.swift | 2 +- .../Models/TypeHolderDefault.swift | 2 +- .../Models/TypeHolderExample.swift | 2 +- .../Sources/PetstoreClient/Models/User.swift | 2 +- .../OpenAPIs/Infrastructure/APIHelper.swift | 21 +----- .../OpenAPIs/Infrastructure/Extensions.swift | 66 ++----------------- .../OpenAPIs/Infrastructure/Models.swift | 2 +- .../Classes/OpenAPIs/Models/Apple.swift | 2 +- .../Classes/OpenAPIs/Models/Banana.swift | 2 +- .../Classes/OpenAPIs/Models/Fruit.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 9 +-- .../Classes/OpenAPIs/APIs/PetAPI.swift | 9 +-- .../OpenAPIs/Infrastructure/APIHelper.swift | 21 +----- .../OpenAPIs/Infrastructure/Extensions.swift | 66 ++----------------- .../OpenAPIs/Infrastructure/Models.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 10 +-- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 9 +-- .../Classes/OpenAPIs/APIs/PetAPI.swift | 9 +-- .../OpenAPIs/Infrastructure/APIHelper.swift | 21 +----- .../OpenAPIs/Infrastructure/Extensions.swift | 66 ++----------------- .../OpenAPIs/Infrastructure/Models.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 10 +-- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 9 +-- .../Classes/OpenAPIs/APIs/PetAPI.swift | 9 +-- .../OpenAPIs/Infrastructure/APIHelper.swift | 21 +----- .../OpenAPIs/Infrastructure/Extensions.swift | 66 ++----------------- .../OpenAPIs/Infrastructure/Models.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../Classes/OpenAPIs/Models/Animal.swift | 2 +- .../Classes/OpenAPIs/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 2 +- .../OpenAPIs/Models/Capitalization.swift | 2 +- .../Classes/OpenAPIs/Models/Cat.swift | 2 +- .../Classes/OpenAPIs/Models/Category.swift | 2 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 2 +- .../Classes/OpenAPIs/Models/Client.swift | 2 +- .../Classes/OpenAPIs/Models/Dog.swift | 2 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 2 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 10 +-- .../Classes/OpenAPIs/Models/File.swift | 2 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 2 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 2 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 2 +- .../Classes/OpenAPIs/Models/List.swift | 2 +- .../Classes/OpenAPIs/Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../OpenAPIs/Models/Model200Response.swift | 2 +- .../Classes/OpenAPIs/Models/Name.swift | 2 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 2 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 2 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 2 +- .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 2 +- .../Classes/OpenAPIs/Models/Return.swift | 2 +- .../OpenAPIs/Models/SpecialModelName.swift | 2 +- .../OpenAPIs/Models/StringBooleanMap.swift | 2 +- .../Classes/OpenAPIs/Models/Tag.swift | 2 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 2 +- .../OpenAPIs/Models/TypeHolderExample.swift | 2 +- .../Classes/OpenAPIs/Models/User.swift | 2 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 9 +-- .../Sources/PetstoreClient/APIs/PetAPI.swift | 9 +-- .../Infrastructure/APIHelper.swift | 21 +----- .../Infrastructure/Extensions.swift | 66 ++----------------- .../Infrastructure/Models.swift | 2 +- .../Models/AdditionalPropertiesClass.swift | 2 +- .../PetstoreClient/Models/Animal.swift | 2 +- .../PetstoreClient/Models/ApiResponse.swift | 2 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 2 +- .../Models/ArrayOfNumberOnly.swift | 2 +- .../PetstoreClient/Models/ArrayTest.swift | 2 +- .../Models/Capitalization.swift | 2 +- .../Sources/PetstoreClient/Models/Cat.swift | 2 +- .../PetstoreClient/Models/Category.swift | 2 +- .../PetstoreClient/Models/ClassModel.swift | 2 +- .../PetstoreClient/Models/Client.swift | 2 +- .../Sources/PetstoreClient/Models/Dog.swift | 2 +- .../PetstoreClient/Models/EnumArrays.swift | 6 +- .../PetstoreClient/Models/EnumClass.swift | 2 +- .../PetstoreClient/Models/EnumTest.swift | 10 +-- .../Sources/PetstoreClient/Models/File.swift | 2 +- .../Models/FileSchemaTestClass.swift | 2 +- .../PetstoreClient/Models/FormatTest.swift | 2 +- .../Models/HasOnlyReadOnly.swift | 2 +- .../Sources/PetstoreClient/Models/List.swift | 2 +- .../PetstoreClient/Models/MapTest.swift | 4 +- ...opertiesAndAdditionalPropertiesClass.swift | 2 +- .../Models/Model200Response.swift | 2 +- .../Sources/PetstoreClient/Models/Name.swift | 2 +- .../PetstoreClient/Models/NumberOnly.swift | 2 +- .../Sources/PetstoreClient/Models/Order.swift | 4 +- .../Models/OuterComposite.swift | 2 +- .../PetstoreClient/Models/OuterEnum.swift | 2 +- .../Sources/PetstoreClient/Models/Pet.swift | 4 +- .../PetstoreClient/Models/ReadOnlyFirst.swift | 2 +- .../PetstoreClient/Models/Return.swift | 2 +- .../Models/SpecialModelName.swift | 2 +- .../Models/StringBooleanMap.swift | 2 +- .../Sources/PetstoreClient/Models/Tag.swift | 2 +- .../Models/TypeHolderDefault.swift | 2 +- .../Models/TypeHolderExample.swift | 2 +- .../Sources/PetstoreClient/Models/User.swift | 2 +- .../OpenAPIs/Infrastructure/APIHelper.swift | 21 +----- .../OpenAPIs/Infrastructure/Extensions.swift | 66 ++----------------- .../OpenAPIs/Infrastructure/Models.swift | 2 +- .../Classes/OpenAPIs/Models/Banana.swift | 2 +- .../PetstoreClient/Models/BigCat.swift | 2 +- .../PetstoreClient/Models/EnumArrays.swift | 4 +- .../PetstoreClient/Models/EnumClass.swift | 2 +- .../PetstoreClient/Models/EnumTest.swift | 8 +-- .../PetstoreClient/Models/MapTest.swift | 2 +- .../Sources/PetstoreClient/Models/Order.swift | 2 +- .../PetstoreClient/Models/OuterEnum.swift | 2 +- .../Sources/PetstoreClient/Models/Pet.swift | 2 +- 501 files changed, 759 insertions(+), 1779 deletions(-) diff --git a/docs/generators/swift6.md b/docs/generators/swift6.md index a49865462eba..e1c238956484 100644 --- a/docs/generators/swift6.md +++ b/docs/generators/swift6.md @@ -56,7 +56,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useBacktickEscapes|Escape reserved words using backticks (default: false)| |false| |useClasses|Use final classes for models instead of structs (default: false)| |false| |useCustomDateWithoutTime|Uses a custom type to decode and encode dates without time information to support OpenAPIs date format (default: false)| |false| -|useJsonEncodable|Make models conform to JSONEncodable protocol (default: true)| |true| |useSPMFileStructure|Use SPM file structure and set the source path to Sources/{{projectName}} (default: true).| |null| |validatable|Make validation rules and validator for model properties (default: true)| |true| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift6ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift6ClientCodegen.java index 824565261940..0b44ed884cbb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift6ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift6ClientCodegen.java @@ -72,7 +72,6 @@ public class Swift6ClientCodegen extends DefaultCodegen implements CodegenConfig public static final String GENERATE_MODEL_ADDITIONAL_PROPERTIES = "generateModelAdditionalProperties"; public static final String HASHABLE_MODELS = "hashableModels"; public static final String IDENTIFIABLE_MODELS = "identifiableModels"; - public static final String USE_JSON_ENCODABLE = "useJsonEncodable"; public static final String MAP_FILE_BINARY_TO_DATA = "mapFileBinaryToData"; public static final String USE_CUSTOM_DATE_WITHOUT_TIME = "useCustomDateWithoutTime"; public static final String VALIDATABLE = "validatable"; @@ -114,8 +113,6 @@ public class Swift6ClientCodegen extends DefaultCodegen implements CodegenConfig protected boolean hashableModels = true; @Setter protected boolean identifiableModels = true; - @Setter - protected boolean useJsonEncodable = true; @Getter @Setter protected boolean mapFileBinaryToData = false; @@ -335,10 +332,6 @@ public Swift6ClientCodegen() { "Make models conform to Identifiable when an id is present (default: true)") .defaultValue(Boolean.TRUE.toString())); - cliOptions.add(new CliOption(USE_JSON_ENCODABLE, - "Make models conform to JSONEncodable protocol (default: true)") - .defaultValue(Boolean.TRUE.toString())); - cliOptions.add(new CliOption(MAP_FILE_BINARY_TO_DATA, "Map File and Binary to Data (default: false)") .defaultValue(Boolean.FALSE.toString())); @@ -560,11 +553,6 @@ public void processOpts() { } additionalProperties.put(IDENTIFIABLE_MODELS, identifiableModels); - if (additionalProperties.containsKey(USE_JSON_ENCODABLE)) { - setUseJsonEncodable(convertPropertyToBooleanAndWriteBack(USE_JSON_ENCODABLE)); - } - additionalProperties.put(USE_JSON_ENCODABLE, useJsonEncodable); - if (additionalProperties.containsKey(MAP_FILE_BINARY_TO_DATA)) { setMapFileBinaryToData(convertPropertyToBooleanAndWriteBack(MAP_FILE_BINARY_TO_DATA)); } diff --git a/modules/openapi-generator/src/main/resources/swift6/APIHelper.mustache b/modules/openapi-generator/src/main/resources/swift6/APIHelper.mustache index 04c8f841528b..99cd5e9ff143 100644 --- a/modules/openapi-generator/src/main/resources/swift6/APIHelper.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/APIHelper.mustache @@ -8,8 +8,8 @@ import Foundation{{#useVapor}} import Vapor{{/useVapor}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} struct APIHelper { - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { - let destination = source.reduce(into: [String: any Sendable]()) { result, item in + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNil(_ source: [Key: Value?]) -> [Key: Value]? { + let destination = source.reduce(into: [Key: Value]()) { result, item in if let value = item.value { result[item.key] = value } @@ -21,7 +21,7 @@ import Vapor{{/useVapor}} return destination } - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { result, item in if let collection = item.value as? [Any?] { result[item.key] = collection @@ -33,21 +33,6 @@ import Vapor{{/useVapor}} } } - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: any Sendable]()) { result, item in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - } - } - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} static func convertAnyToString(_ value: Any?) -> String? { guard let value = value else { return nil } if let value = value as? any RawRepresentable { diff --git a/modules/openapi-generator/src/main/resources/swift6/Extensions.mustache b/modules/openapi-generator/src/main/resources/swift6/Extensions.mustache index 78526b60ee8a..f38e97002a8a 100644 --- a/modules/openapi-generator/src/main/resources/swift6/Extensions.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/Extensions.mustache @@ -11,57 +11,14 @@ import FoundationNetworking @preconcurrency import PromiseKit{{/usePromiseKit}}{{#useVapor}} import Vapor{{/useVapor}}{{^useVapor}} -extension QueryStringEncodable { - @_disfavoredOverload - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Bool: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Float: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int32: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int64: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Double: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Decimal: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension String: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension URL: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension UUID: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension RawRepresentable where RawValue: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) } +extension RawRepresentable where Self: CustomQueryStringEncodable { + func encodeToQueryString(codableHelper: CodableHelper) -> String { + encodeIfPossible(rawValue, codableHelper: codableHelper) + } } private func encodeIfPossible(_ object: T, codableHelper: CodableHelper) -> String { - if let encodableObject = object as? QueryStringEncodable { + if let encodableObject = object as? any CustomQueryStringEncodable { return encodableObject.encodeToQueryString(codableHelper: codableHelper) } else { return String(describing: object) @@ -90,25 +47,16 @@ extension Dictionary { } } -extension Data: QueryStringEncodable { +extension Data: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } -extension Date: QueryStringEncodable { +extension Date: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return codableHelper.dateFormatter.string(from: self) } -} - -extension QueryStringEncodable where Self: Encodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { - guard let data = try? codableHelper.jsonEncoder.encode(self) else { - fatalError("Could not encode to json: \(self)") - } - return data.encodeToQueryString(codableHelper: codableHelper) - } }{{/useVapor}}{{#generateModelAdditionalProperties}} extension String: @retroactive CodingKey { diff --git a/modules/openapi-generator/src/main/resources/swift6/Models.mustache b/modules/openapi-generator/src/main/resources/swift6/Models.mustache index 14b236ee221f..fb4fbfe40cb0 100644 --- a/modules/openapi-generator/src/main/resources/swift6/Models.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/Models.mustache @@ -10,7 +10,7 @@ import FoundationNetworking #endif{{#useAlamofire}} import Alamofire{{/useAlamofire}} -protocol QueryStringEncodable { +protocol CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String } diff --git a/modules/openapi-generator/src/main/resources/swift6/OpenAPIDateWithoutTime.mustache b/modules/openapi-generator/src/main/resources/swift6/OpenAPIDateWithoutTime.mustache index aee5bf79010c..2c124fe25fdc 100644 --- a/modules/openapi-generator/src/main/resources/swift6/OpenAPIDateWithoutTime.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/OpenAPIDateWithoutTime.mustache @@ -76,7 +76,7 @@ import Foundation } } -extension OpenAPIDateWithoutTime: QueryStringEncodable { +extension OpenAPIDateWithoutTime: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return OpenISO8601DateFormatter.withoutTime.string(from: self.normalizedWrappedDate()) } diff --git a/modules/openapi-generator/src/main/resources/swift6/api.mustache b/modules/openapi-generator/src/main/resources/swift6/api.mustache index a4728dbfb84a..a7f07464d17e 100644 --- a/modules/openapi-generator/src/main/resources/swift6/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/api.mustache @@ -301,8 +301,7 @@ extension {{projectName}}API { {{/formParams}} ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) {{/hasFormParams}} {{^hasFormParams}} let localVariableParameters: [String: any Sendable]? = nil diff --git a/modules/openapi-generator/src/main/resources/swift6/modelEnum.mustache b/modules/openapi-generator/src/main/resources/swift6/modelEnum.mustache index f50a704459bc..f61fe24ebb15 100644 --- a/modules/openapi-generator/src/main/resources/swift6/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/modelEnum.mustache @@ -1,4 +1,4 @@ -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{dataType}}, Sendable, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{^isString}}{{^isInteger}}{{^isFloat}}{{^isDouble}}{{#useJsonEncodable}}, QueryStringEncodable{{/useJsonEncodable}}{{/isDouble}}{{/isFloat}}{{/isInteger}}{{/isString}}{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{/enumUnknownDefaultCase}} { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{dataType}}, Sendable, CustomQueryStringEncodable, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{/enumUnknownDefaultCase}} { {{#allowableValues}} {{#enumVars}} case {{{name}}} = {{{value}}} diff --git a/modules/openapi-generator/src/main/resources/swift6/modelInlineEnumDeclaration.mustache b/modules/openapi-generator/src/main/resources/swift6/modelInlineEnumDeclaration.mustache index eb6999268cc2..61a61baef93f 100644 --- a/modules/openapi-generator/src/main/resources/swift6/modelInlineEnumDeclaration.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/modelInlineEnumDeclaration.mustache @@ -1,4 +1,4 @@ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, Sendable, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{^isContainer}}{{^isString}}{{^isInteger}}{{^isFloat}}{{^isDouble}}{{#useJsonEncodable}}, QueryStringEncodable{{/useJsonEncodable}}{{/isDouble}}{{/isFloat}}{{/isInteger}}{{/isString}}{{/isContainer}}{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{#isContainer}}, CaseIterableDefaultsLast{{/isContainer}}{{/enumUnknownDefaultCase}} { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, Sendable, CustomQueryStringEncodable, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{#isContainer}}, CaseIterableDefaultsLast{{/isContainer}}{{/enumUnknownDefaultCase}} { {{#allowableValues}} {{#enumVars}} case {{{name}}} = {{{value}}} diff --git a/modules/openapi-generator/src/main/resources/swift6/modelObject.mustache b/modules/openapi-generator/src/main/resources/swift6/modelObject.mustache index 52da0f11189a..189c245ffc62 100644 --- a/modules/openapi-generator/src/main/resources/swift6/modelObject.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/modelObject.mustache @@ -1,5 +1,5 @@ -{{^objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#useClasses}}final class{{/useClasses}}{{^useClasses}}struct{{/useClasses}} {{{classname}}}: {{^useClasses}}Sendable, {{/useClasses}}{{#useClasses}}{{#readonlyProperties}}@unchecked Sendable, {{/readonlyProperties}}{{/useClasses}}{{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable{{#useJsonEncodable}}, QueryStringEncodable{{/useJsonEncodable}}{{/useVapor}}{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}} { -{{/objcCompatible}}{{#objcCompatible}}@objcMembers {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class {{classname}}: NSObject, Codable{{#useJsonEncodable}}, QueryStringEncodable{{/useJsonEncodable}} { +{{^objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#useClasses}}final class{{/useClasses}}{{^useClasses}}struct{{/useClasses}} {{{classname}}}: {{^useClasses}}Sendable, {{/useClasses}}{{#useClasses}}{{#readonlyProperties}}@unchecked Sendable, {{/readonlyProperties}}{{/useClasses}}{{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}} { +{{/objcCompatible}}{{#objcCompatible}}@objcMembers {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} class {{classname}}: NSObject, Codable { {{/objcCompatible}} {{#allVars}} diff --git a/modules/openapi-generator/src/main/resources/swift6/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/swift6/modelOneOf.mustache index 8a3b7f158f5c..9c8d75da0096 100644 --- a/modules/openapi-generator/src/main/resources/swift6/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/modelOneOf.mustache @@ -1,4 +1,4 @@ -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{^useClasses}}Sendable, {{/useClasses}}{{#useClasses}}{{#readonlyProperties}}Sendable, {{/readonlyProperties}}{{/useClasses}}{{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable{{#useJsonEncodable}}, QueryStringEncodable{{/useJsonEncodable}}{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}}{{/useVapor}} { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{^useClasses}}Sendable, {{/useClasses}}{{#useClasses}}{{#readonlyProperties}}Sendable, {{/readonlyProperties}}{{/useClasses}}{{#useVapor}}Content{{/useVapor}}{{^useVapor}}Codable{{#vendorExtensions.x-swift-hashable}}, Hashable{{/vendorExtensions.x-swift-hashable}}{{/useVapor}} { {{#oneOf}} case type{{#transformArrayType}}{{.}}{{/transformArrayType}}({{.}}) {{/oneOf}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift6ClientCodegenOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift6ClientCodegenOptionsProvider.java index cf951b0113e3..56762761d57a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift6ClientCodegenOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift6ClientCodegenOptionsProvider.java @@ -48,7 +48,6 @@ public class Swift6ClientCodegenOptionsProvider implements OptionsProvider { public static final String GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE = "true"; public static final String HASHABLE_MODELS_VALUE = "true"; public static final String IDENTIFIABLE_MODELS_VALUE = "true"; - public static final String USE_JSON_ENCODABLE_VALUE = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; public static final String LIBRARY_VALUE = "alamofire"; @@ -99,7 +98,6 @@ public Map createOptions() { GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE) .put(Swift6ClientCodegen.HASHABLE_MODELS, HASHABLE_MODELS_VALUE) .put(Swift6ClientCodegen.IDENTIFIABLE_MODELS, IDENTIFIABLE_MODELS_VALUE) - .put(Swift6ClientCodegen.USE_JSON_ENCODABLE, USE_JSON_ENCODABLE_VALUE) .put(Swift6ClientCodegen.MAP_FILE_BINARY_TO_DATA, "false") .put(Swift6ClientCodegen.USE_CUSTOM_DATE_WITHOUT_TIME, "false") .put(Swift6ClientCodegen.VALIDATABLE, "true") diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index 4970cec8d0ca..6ecb12a0dede 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -392,8 +392,7 @@ open class FakeAPI { "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -524,8 +523,7 @@ open class FakeAPI { "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ @@ -690,8 +688,7 @@ open class FakeAPI { "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index 32397a81b623..61180a5aeffd 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -366,8 +366,7 @@ open class PetAPI { "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -426,8 +425,7 @@ open class PetAPI { "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -486,8 +484,7 @@ open class PetAPI { "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift index b4218d3375c9..48606ea44cd1 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift @@ -7,8 +7,8 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { - let destination = source.reduce(into: [String: any Sendable]()) { result, item in + public static func rejectNil(_ source: [Key: Value?]) -> [Key: Value]? { + let destination = source.reduce(into: [Key: Value]()) { result, item in if let value = item.value { result[item.key] = value } @@ -20,7 +20,7 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { result, item in if let collection = item.value as? [Any?] { result[item.key] = collection @@ -32,21 +32,6 @@ public struct APIHelper { } } - public static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: any Sendable]()) { result, item in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - } - } - public static func convertAnyToString(_ value: Any?) -> String? { guard let value = value else { return nil } if let value = value as? any RawRepresentable { diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift index 1120f928d7ea..1cd0daecc9f0 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift @@ -9,57 +9,14 @@ import Foundation import FoundationNetworking #endif -extension QueryStringEncodable { - @_disfavoredOverload - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Bool: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Float: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int32: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int64: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Double: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Decimal: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension String: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension URL: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension UUID: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension RawRepresentable where RawValue: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) } +extension RawRepresentable where Self: CustomQueryStringEncodable { + func encodeToQueryString(codableHelper: CodableHelper) -> String { + encodeIfPossible(rawValue, codableHelper: codableHelper) + } } private func encodeIfPossible(_ object: T, codableHelper: CodableHelper) -> String { - if let encodableObject = object as? QueryStringEncodable { + if let encodableObject = object as? any CustomQueryStringEncodable { return encodableObject.encodeToQueryString(codableHelper: codableHelper) } else { return String(describing: object) @@ -88,27 +45,18 @@ extension Dictionary { } } -extension Data: QueryStringEncodable { +extension Data: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } -extension Date: QueryStringEncodable { +extension Date: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return codableHelper.dateFormatter.string(from: self) } } -extension QueryStringEncodable where Self: Encodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { - guard let data = try? codableHelper.jsonEncoder.encode(self) else { - fatalError("Could not encode to json: \(self)") - } - return data.encodeToQueryString(codableHelper: codableHelper) - } -} - extension String: @retroactive CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Models.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Models.swift index 9414c8dfaeb3..ea556d99c214 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/Models.swift @@ -10,7 +10,7 @@ import FoundationNetworking #endif import Alamofire -protocol QueryStringEncodable { +protocol CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String } diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/OpenAPIDateWithoutTime.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/OpenAPIDateWithoutTime.swift index 8b0af6a53eca..05e8ad3297d1 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/OpenAPIDateWithoutTime.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Infrastructure/OpenAPIDateWithoutTime.swift @@ -76,7 +76,7 @@ public struct OpenAPIDateWithoutTime: Sendable, Codable, Hashable, Equatable { } } -extension OpenAPIDateWithoutTime: QueryStringEncodable { +extension OpenAPIDateWithoutTime: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return OpenISO8601DateFormatter.withoutTime.string(from: self.normalizedWrappedDate()) } diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift index 9bd081f7d001..e15887fc3585 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct AdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct AdditionalPropertiesClass: Sendable, Codable, Hashable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Animal.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Animal.swift index b20104e0503d..846d0bffd42e 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Animal.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Animal.swift @@ -7,7 +7,7 @@ import Foundation -public struct Animal: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Animal: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ApiResponse.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ApiResponse.swift index cea25ea52e2f..5f8cfe3d5102 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ApiResponse.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ApiResponse.swift @@ -7,7 +7,7 @@ import Foundation -public struct ApiResponse: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ApiResponse: Sendable, Codable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift index 679279d61cb8..63dfb69bbabb 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift index d71bd4e40b7f..3ed50f5074e1 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ArrayTest.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ArrayTest.swift index 839795229bb7..652ad17e7778 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ArrayTest.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ArrayTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayTest: Sendable, Codable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Capitalization.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Capitalization.swift index 56100523e841..a86eb5e7cc3f 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Capitalization.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Capitalization.swift @@ -7,7 +7,7 @@ import Foundation -public struct Capitalization: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Capitalization: Sendable, Codable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Cat.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Cat.swift index cceeddd1bf93..f4b05d09080b 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Cat.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Cat.swift @@ -7,7 +7,7 @@ import Foundation -public struct Cat: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Cat: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Category.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Category.swift index c04a9e673cf4..64f4cbd29125 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Category.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Category.swift @@ -7,7 +7,7 @@ import Foundation -public struct Category: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Category: Sendable, Codable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ClassModel.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ClassModel.swift index 4c1e9c1a990b..559a00895906 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ClassModel.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ClassModel.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ClassModel: Sendable, Codable, Hashable { public var _class: String? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Client.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Client.swift index b49ded4cc5c1..171b4da0eca7 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Client.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Client.swift @@ -7,7 +7,7 @@ import Foundation -public struct Client: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Client: Sendable, Codable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Dog.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Dog.swift index 99231ca03f72..d48f9e70e605 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Dog.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Dog.swift @@ -7,7 +7,7 @@ import Foundation -public struct Dog: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Dog: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/EnumArrays.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/EnumArrays.swift index 09bbcb9f2807..7bd97f59b82e 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/EnumArrays.swift @@ -7,13 +7,13 @@ import Foundation -public struct EnumArrays: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumArrays: Sendable, Codable, Hashable { - public enum JustSymbol: String, Sendable, Codable, CaseIterable { + public enum JustSymbol: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" case dollar = "$" } - public enum ArrayEnum: String, Sendable, Codable, CaseIterable { + public enum ArrayEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case fish = "fish" case crab = "crab" } diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/EnumClass.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/EnumClass.swift index 56823c3a7aa1..b94c29a792cc 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/EnumClass.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/EnumClass.swift @@ -7,7 +7,7 @@ import Foundation -public enum EnumClass: String, Sendable, Codable, CaseIterable { +public enum EnumClass: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" case xyz = "(xyz)" diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/EnumTest.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/EnumTest.swift index d280112e88b3..9dd889d5fd6c 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/EnumTest.swift @@ -7,23 +7,23 @@ import Foundation -public struct EnumTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumTest: Sendable, Codable, Hashable { - public enum EnumString: String, Sendable, Codable, CaseIterable { + public enum EnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumStringRequired: String, Sendable, Codable, CaseIterable { + public enum EnumStringRequired: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumInteger: Int, Sendable, Codable, CaseIterable { + public enum EnumInteger: Int, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _1 = 1 case number1 = -1 } - public enum EnumNumber: Double, Sendable, Codable, CaseIterable { + public enum EnumNumber: Double, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _11 = 1.1 case number12 = -1.2 } diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/File.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/File.swift index c35e1b2d53a4..7360adbc0a29 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/File.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/File.swift @@ -8,7 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Sendable, Codable, QueryStringEncodable, Hashable { +public struct File: Sendable, Codable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift index 6ca430a91ba7..54afadae66b5 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct FileSchemaTestClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FileSchemaTestClass: Sendable, Codable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/FormatTest.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/FormatTest.swift index c39b80d41453..3051d9ab9c53 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/FormatTest.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/FormatTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct FormatTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FormatTest: Sendable, Codable, Hashable { public static let integerRule = NumericRule(minimum: 10, exclusiveMinimum: false, maximum: 100, exclusiveMaximum: false, multipleOf: nil) public static let int32Rule = NumericRule(minimum: 20, exclusiveMinimum: false, maximum: 200, exclusiveMaximum: false, multipleOf: nil) diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift index e5db62551691..5b5fe48fb7e5 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct HasOnlyReadOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct HasOnlyReadOnly: Sendable, Codable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/List.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/List.swift index 75c553df8fc5..78e1feb2beff 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/List.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/List.swift @@ -7,7 +7,7 @@ import Foundation -public struct List: Sendable, Codable, QueryStringEncodable, Hashable { +public struct List: Sendable, Codable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/MapTest.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/MapTest.swift index 8cc06717f317..210eef142f1e 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/MapTest.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/MapTest.swift @@ -7,9 +7,9 @@ import Foundation -public struct MapTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MapTest: Sendable, Codable, Hashable { - public enum MapOfEnumString: String, Sendable, Codable, CaseIterable { + public enum MapOfEnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 2c7bd6d9c7c2..06c6a2752677 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Model200Response.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Model200Response.swift index dfe19e3fdd91..aeab3b15a102 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Model200Response.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Model200Response.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Model200Response: Sendable, Codable, Hashable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Name.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Name.swift index d0a98e0980bc..4f6830570025 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Name.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Name.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Name: Sendable, Codable, Hashable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/NumberOnly.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/NumberOnly.swift index 47d2e318bb5a..3621d67757e9 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/NumberOnly.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/NumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct NumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct NumberOnly: Sendable, Codable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Order.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Order.swift index 6a9ecc5540c2..d4bc36f1f897 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Order.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Order.swift @@ -7,9 +7,9 @@ import Foundation -public struct Order: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Order: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/OuterComposite.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/OuterComposite.swift index 0a4d002a2dda..5893a2807418 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/OuterComposite.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/OuterComposite.swift @@ -7,7 +7,7 @@ import Foundation -public struct OuterComposite: Sendable, Codable, QueryStringEncodable, Hashable { +public struct OuterComposite: Sendable, Codable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/OuterEnum.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/OuterEnum.swift index 9bcdaab8b218..3a5e3a720a24 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/OuterEnum.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/OuterEnum.swift @@ -7,7 +7,7 @@ import Foundation -public enum OuterEnum: String, Sendable, Codable, CaseIterable { +public enum OuterEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Pet.swift index 302a3052c6e5..97769ad6256b 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Pet.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Pet.swift @@ -7,9 +7,9 @@ import Foundation -public struct Pet: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Pet: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case available = "available" case pending = "pending" case sold = "sold" diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift index 5a06da436f6a..fd389ad1422d 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift @@ -7,7 +7,7 @@ import Foundation -public struct ReadOnlyFirst: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ReadOnlyFirst: Sendable, Codable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Return.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Return.swift index 53ca3f5ad7f8..2fd94d66e2ab 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Return.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Return.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Return: Sendable, Codable, Hashable { public var _return: Int? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift index 40ad8ff0a055..95c7afe37e25 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift @@ -7,7 +7,7 @@ import Foundation -public struct SpecialModelName: Sendable, Codable, QueryStringEncodable, Hashable { +public struct SpecialModelName: Sendable, Codable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift index 3bbade9feb7b..50ecf3d40383 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift @@ -7,7 +7,7 @@ import Foundation -public struct StringBooleanMap: Sendable, Codable, QueryStringEncodable, Hashable { +public struct StringBooleanMap: Sendable, Codable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Tag.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Tag.swift index 7c19767a11fa..510c09ab0201 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Tag.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Tag.swift @@ -7,7 +7,7 @@ import Foundation -public struct Tag: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Tag: Sendable, Codable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift index eaaab7295001..0824151955c3 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderDefault: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderDefault: Sendable, Codable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift index bac80c4fcd25..437e8d3a7a02 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderExample: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderExample: Sendable, Codable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/User.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/User.swift index e41975d4d669..f012dafe19c6 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/User.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/User.swift @@ -7,7 +7,7 @@ import Foundation -public struct User: Sendable, Codable, QueryStringEncodable, Hashable { +public struct User: Sendable, Codable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift index 178aeff96713..3313b41899d0 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -1249,8 +1249,7 @@ open class FakeAPI { "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -1517,8 +1516,7 @@ open class FakeAPI { "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ @@ -2016,8 +2014,7 @@ open class FakeAPI { "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift index 73a0ac9919a3..4132d046355a 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift @@ -1102,8 +1102,7 @@ open class PetAPI { "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -1273,8 +1272,7 @@ open class PetAPI { "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -1444,8 +1442,7 @@ open class PetAPI { "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIHelper.swift index b4218d3375c9..48606ea44cd1 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/APIHelper.swift @@ -7,8 +7,8 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { - let destination = source.reduce(into: [String: any Sendable]()) { result, item in + public static func rejectNil(_ source: [Key: Value?]) -> [Key: Value]? { + let destination = source.reduce(into: [Key: Value]()) { result, item in if let value = item.value { result[item.key] = value } @@ -20,7 +20,7 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { result, item in if let collection = item.value as? [Any?] { result[item.key] = collection @@ -32,21 +32,6 @@ public struct APIHelper { } } - public static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: any Sendable]()) { result, item in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - } - } - public static func convertAnyToString(_ value: Any?) -> String? { guard let value = value else { return nil } if let value = value as? any RawRepresentable { diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Extensions.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Extensions.swift index 74e95feeeedb..aff7cbf88c3a 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Extensions.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Extensions.swift @@ -10,57 +10,14 @@ import FoundationNetworking #endif @preconcurrency import PromiseKit -extension QueryStringEncodable { - @_disfavoredOverload - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Bool: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Float: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int32: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int64: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Double: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Decimal: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension String: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension URL: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension UUID: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension RawRepresentable where RawValue: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) } +extension RawRepresentable where Self: CustomQueryStringEncodable { + func encodeToQueryString(codableHelper: CodableHelper) -> String { + encodeIfPossible(rawValue, codableHelper: codableHelper) + } } private func encodeIfPossible(_ object: T, codableHelper: CodableHelper) -> String { - if let encodableObject = object as? QueryStringEncodable { + if let encodableObject = object as? any CustomQueryStringEncodable { return encodableObject.encodeToQueryString(codableHelper: codableHelper) } else { return String(describing: object) @@ -89,27 +46,18 @@ extension Dictionary { } } -extension Data: QueryStringEncodable { +extension Data: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } -extension Date: QueryStringEncodable { +extension Date: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return codableHelper.dateFormatter.string(from: self) } } -extension QueryStringEncodable where Self: Encodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { - guard let data = try? codableHelper.jsonEncoder.encode(self) else { - fatalError("Could not encode to json: \(self)") - } - return data.encodeToQueryString(codableHelper: codableHelper) - } -} - extension String: @retroactive CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Models.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Models.swift index 9414c8dfaeb3..ea556d99c214 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Infrastructure/Models.swift @@ -10,7 +10,7 @@ import FoundationNetworking #endif import Alamofire -protocol QueryStringEncodable { +protocol CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String } diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift index 9bd081f7d001..e15887fc3585 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct AdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct AdditionalPropertiesClass: Sendable, Codable, Hashable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Animal.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Animal.swift index b20104e0503d..846d0bffd42e 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Animal.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Animal.swift @@ -7,7 +7,7 @@ import Foundation -public struct Animal: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Animal: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ApiResponse.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ApiResponse.swift index cea25ea52e2f..5f8cfe3d5102 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ApiResponse.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ApiResponse.swift @@ -7,7 +7,7 @@ import Foundation -public struct ApiResponse: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ApiResponse: Sendable, Codable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift index 679279d61cb8..63dfb69bbabb 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift index d71bd4e40b7f..3ed50f5074e1 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ArrayTest.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ArrayTest.swift index 839795229bb7..652ad17e7778 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ArrayTest.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ArrayTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayTest: Sendable, Codable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Capitalization.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Capitalization.swift index 56100523e841..a86eb5e7cc3f 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Capitalization.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Capitalization.swift @@ -7,7 +7,7 @@ import Foundation -public struct Capitalization: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Capitalization: Sendable, Codable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Cat.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Cat.swift index cceeddd1bf93..f4b05d09080b 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Cat.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Cat.swift @@ -7,7 +7,7 @@ import Foundation -public struct Cat: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Cat: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Category.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Category.swift index c04a9e673cf4..64f4cbd29125 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Category.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Category.swift @@ -7,7 +7,7 @@ import Foundation -public struct Category: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Category: Sendable, Codable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ClassModel.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ClassModel.swift index 4c1e9c1a990b..559a00895906 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ClassModel.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ClassModel.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ClassModel: Sendable, Codable, Hashable { public var _class: String? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Client.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Client.swift index b49ded4cc5c1..171b4da0eca7 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Client.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Client.swift @@ -7,7 +7,7 @@ import Foundation -public struct Client: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Client: Sendable, Codable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Dog.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Dog.swift index 99231ca03f72..d48f9e70e605 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Dog.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Dog.swift @@ -7,7 +7,7 @@ import Foundation -public struct Dog: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Dog: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/EnumArrays.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/EnumArrays.swift index 09bbcb9f2807..7bd97f59b82e 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/EnumArrays.swift @@ -7,13 +7,13 @@ import Foundation -public struct EnumArrays: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumArrays: Sendable, Codable, Hashable { - public enum JustSymbol: String, Sendable, Codable, CaseIterable { + public enum JustSymbol: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" case dollar = "$" } - public enum ArrayEnum: String, Sendable, Codable, CaseIterable { + public enum ArrayEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case fish = "fish" case crab = "crab" } diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/EnumClass.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/EnumClass.swift index 56823c3a7aa1..b94c29a792cc 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/EnumClass.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/EnumClass.swift @@ -7,7 +7,7 @@ import Foundation -public enum EnumClass: String, Sendable, Codable, CaseIterable { +public enum EnumClass: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" case xyz = "(xyz)" diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/EnumTest.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/EnumTest.swift index d280112e88b3..9dd889d5fd6c 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/EnumTest.swift @@ -7,23 +7,23 @@ import Foundation -public struct EnumTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumTest: Sendable, Codable, Hashable { - public enum EnumString: String, Sendable, Codable, CaseIterable { + public enum EnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumStringRequired: String, Sendable, Codable, CaseIterable { + public enum EnumStringRequired: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumInteger: Int, Sendable, Codable, CaseIterable { + public enum EnumInteger: Int, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _1 = 1 case number1 = -1 } - public enum EnumNumber: Double, Sendable, Codable, CaseIterable { + public enum EnumNumber: Double, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _11 = 1.1 case number12 = -1.2 } diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/File.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/File.swift index c35e1b2d53a4..7360adbc0a29 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/File.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/File.swift @@ -8,7 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Sendable, Codable, QueryStringEncodable, Hashable { +public struct File: Sendable, Codable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/FileSchemaTestClass.swift index 6ca430a91ba7..54afadae66b5 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/FileSchemaTestClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct FileSchemaTestClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FileSchemaTestClass: Sendable, Codable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/FormatTest.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/FormatTest.swift index 010eddcabde6..14a0f032d53e 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/FormatTest.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/FormatTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct FormatTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FormatTest: Sendable, Codable, Hashable { public static let integerRule = NumericRule(minimum: 10, exclusiveMinimum: false, maximum: 100, exclusiveMaximum: false, multipleOf: nil) public static let int32Rule = NumericRule(minimum: 20, exclusiveMinimum: false, maximum: 200, exclusiveMaximum: false, multipleOf: nil) diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift index e5db62551691..5b5fe48fb7e5 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct HasOnlyReadOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct HasOnlyReadOnly: Sendable, Codable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/List.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/List.swift index 75c553df8fc5..78e1feb2beff 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/List.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/List.swift @@ -7,7 +7,7 @@ import Foundation -public struct List: Sendable, Codable, QueryStringEncodable, Hashable { +public struct List: Sendable, Codable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/MapTest.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/MapTest.swift index b52d28b69a1e..dc024a925e0b 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/MapTest.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/MapTest.swift @@ -7,9 +7,9 @@ import Foundation -public struct MapTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MapTest: Sendable, Codable, Hashable { - public enum MapOfEnumString: String, Sendable, Codable, CaseIterable { + public enum MapOfEnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 2c7bd6d9c7c2..06c6a2752677 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Model200Response.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Model200Response.swift index dfe19e3fdd91..aeab3b15a102 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Model200Response.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Model200Response.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Model200Response: Sendable, Codable, Hashable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Name.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Name.swift index d0a98e0980bc..4f6830570025 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Name.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Name.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Name: Sendable, Codable, Hashable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/NumberOnly.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/NumberOnly.swift index 47d2e318bb5a..3621d67757e9 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/NumberOnly.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/NumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct NumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct NumberOnly: Sendable, Codable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Order.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Order.swift index 6a9ecc5540c2..d4bc36f1f897 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Order.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Order.swift @@ -7,9 +7,9 @@ import Foundation -public struct Order: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Order: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/OuterComposite.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/OuterComposite.swift index 0a4d002a2dda..5893a2807418 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/OuterComposite.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/OuterComposite.swift @@ -7,7 +7,7 @@ import Foundation -public struct OuterComposite: Sendable, Codable, QueryStringEncodable, Hashable { +public struct OuterComposite: Sendable, Codable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/OuterEnum.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/OuterEnum.swift index 9bcdaab8b218..3a5e3a720a24 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/OuterEnum.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/OuterEnum.swift @@ -7,7 +7,7 @@ import Foundation -public enum OuterEnum: String, Sendable, Codable, CaseIterable { +public enum OuterEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Pet.swift index 302a3052c6e5..97769ad6256b 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Pet.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Pet.swift @@ -7,9 +7,9 @@ import Foundation -public struct Pet: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Pet: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case available = "available" case pending = "pending" case sold = "sold" diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ReadOnlyFirst.swift index 5a06da436f6a..fd389ad1422d 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/ReadOnlyFirst.swift @@ -7,7 +7,7 @@ import Foundation -public struct ReadOnlyFirst: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ReadOnlyFirst: Sendable, Codable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Return.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Return.swift index 53ca3f5ad7f8..2fd94d66e2ab 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Return.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Return.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Return: Sendable, Codable, Hashable { public var _return: Int? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/SpecialModelName.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/SpecialModelName.swift index 40ad8ff0a055..95c7afe37e25 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/SpecialModelName.swift @@ -7,7 +7,7 @@ import Foundation -public struct SpecialModelName: Sendable, Codable, QueryStringEncodable, Hashable { +public struct SpecialModelName: Sendable, Codable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Tag.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Tag.swift index 7c19767a11fa..510c09ab0201 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Tag.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Tag.swift @@ -7,7 +7,7 @@ import Foundation -public struct Tag: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Tag: Sendable, Codable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/TypeHolderDefault.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/TypeHolderDefault.swift index eaaab7295001..0824151955c3 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/TypeHolderDefault.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderDefault: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderDefault: Sendable, Codable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/TypeHolderExample.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/TypeHolderExample.swift index bac80c4fcd25..437e8d3a7a02 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/TypeHolderExample.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderExample: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderExample: Sendable, Codable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/User.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/User.swift index e41975d4d669..f012dafe19c6 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/User.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/User.swift @@ -7,7 +7,7 @@ import Foundation -public struct User: Sendable, Codable, QueryStringEncodable, Hashable { +public struct User: Sendable, Codable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index b388f5c5571a..1a30b08fdb2f 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -336,8 +336,7 @@ open class FakeAPI { "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -461,8 +460,7 @@ open class FakeAPI { "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ @@ -606,8 +604,7 @@ open class FakeAPI { "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index d680aa5e425c..72483c6529b2 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -317,8 +317,7 @@ open class PetAPI { "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -370,8 +369,7 @@ open class PetAPI { "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -423,8 +421,7 @@ open class PetAPI { "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift index b4218d3375c9..48606ea44cd1 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift @@ -7,8 +7,8 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { - let destination = source.reduce(into: [String: any Sendable]()) { result, item in + public static func rejectNil(_ source: [Key: Value?]) -> [Key: Value]? { + let destination = source.reduce(into: [Key: Value]()) { result, item in if let value = item.value { result[item.key] = value } @@ -20,7 +20,7 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { result, item in if let collection = item.value as? [Any?] { result[item.key] = collection @@ -32,21 +32,6 @@ public struct APIHelper { } } - public static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: any Sendable]()) { result, item in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - } - } - public static func convertAnyToString(_ value: Any?) -> String? { guard let value = value else { return nil } if let value = value as? any RawRepresentable { diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift index 1120f928d7ea..1cd0daecc9f0 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift @@ -9,57 +9,14 @@ import Foundation import FoundationNetworking #endif -extension QueryStringEncodable { - @_disfavoredOverload - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Bool: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Float: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int32: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int64: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Double: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Decimal: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension String: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension URL: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension UUID: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension RawRepresentable where RawValue: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) } +extension RawRepresentable where Self: CustomQueryStringEncodable { + func encodeToQueryString(codableHelper: CodableHelper) -> String { + encodeIfPossible(rawValue, codableHelper: codableHelper) + } } private func encodeIfPossible(_ object: T, codableHelper: CodableHelper) -> String { - if let encodableObject = object as? QueryStringEncodable { + if let encodableObject = object as? any CustomQueryStringEncodable { return encodableObject.encodeToQueryString(codableHelper: codableHelper) } else { return String(describing: object) @@ -88,27 +45,18 @@ extension Dictionary { } } -extension Data: QueryStringEncodable { +extension Data: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } -extension Date: QueryStringEncodable { +extension Date: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return codableHelper.dateFormatter.string(from: self) } } -extension QueryStringEncodable where Self: Encodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { - guard let data = try? codableHelper.jsonEncoder.encode(self) else { - fatalError("Could not encode to json: \(self)") - } - return data.encodeToQueryString(codableHelper: codableHelper) - } -} - extension String: @retroactive CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Models.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Models.swift index 78a06110af5e..59d2cdf20c67 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Infrastructure/Models.swift @@ -9,7 +9,7 @@ import Foundation import FoundationNetworking #endif -protocol QueryStringEncodable { +protocol CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String } diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift index 9bd081f7d001..e15887fc3585 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct AdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct AdditionalPropertiesClass: Sendable, Codable, Hashable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Animal.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Animal.swift index b20104e0503d..846d0bffd42e 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Animal.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Animal.swift @@ -7,7 +7,7 @@ import Foundation -public struct Animal: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Animal: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ApiResponse.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ApiResponse.swift index cea25ea52e2f..5f8cfe3d5102 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ApiResponse.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ApiResponse.swift @@ -7,7 +7,7 @@ import Foundation -public struct ApiResponse: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ApiResponse: Sendable, Codable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift index 679279d61cb8..63dfb69bbabb 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift index d71bd4e40b7f..3ed50f5074e1 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ArrayTest.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ArrayTest.swift index 839795229bb7..652ad17e7778 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ArrayTest.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ArrayTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayTest: Sendable, Codable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Capitalization.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Capitalization.swift index 56100523e841..a86eb5e7cc3f 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Capitalization.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Capitalization.swift @@ -7,7 +7,7 @@ import Foundation -public struct Capitalization: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Capitalization: Sendable, Codable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Cat.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Cat.swift index cceeddd1bf93..f4b05d09080b 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Cat.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Cat.swift @@ -7,7 +7,7 @@ import Foundation -public struct Cat: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Cat: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Category.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Category.swift index c04a9e673cf4..64f4cbd29125 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Category.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Category.swift @@ -7,7 +7,7 @@ import Foundation -public struct Category: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Category: Sendable, Codable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ClassModel.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ClassModel.swift index 4c1e9c1a990b..559a00895906 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ClassModel.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ClassModel.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ClassModel: Sendable, Codable, Hashable { public var _class: String? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Client.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Client.swift index b49ded4cc5c1..171b4da0eca7 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Client.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Client.swift @@ -7,7 +7,7 @@ import Foundation -public struct Client: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Client: Sendable, Codable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Dog.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Dog.swift index 99231ca03f72..d48f9e70e605 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Dog.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Dog.swift @@ -7,7 +7,7 @@ import Foundation -public struct Dog: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Dog: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/EnumArrays.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/EnumArrays.swift index 09bbcb9f2807..7bd97f59b82e 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/EnumArrays.swift @@ -7,13 +7,13 @@ import Foundation -public struct EnumArrays: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumArrays: Sendable, Codable, Hashable { - public enum JustSymbol: String, Sendable, Codable, CaseIterable { + public enum JustSymbol: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" case dollar = "$" } - public enum ArrayEnum: String, Sendable, Codable, CaseIterable { + public enum ArrayEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case fish = "fish" case crab = "crab" } diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/EnumClass.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/EnumClass.swift index 56823c3a7aa1..b94c29a792cc 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/EnumClass.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/EnumClass.swift @@ -7,7 +7,7 @@ import Foundation -public enum EnumClass: String, Sendable, Codable, CaseIterable { +public enum EnumClass: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" case xyz = "(xyz)" diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/EnumTest.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/EnumTest.swift index d280112e88b3..9dd889d5fd6c 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/EnumTest.swift @@ -7,23 +7,23 @@ import Foundation -public struct EnumTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumTest: Sendable, Codable, Hashable { - public enum EnumString: String, Sendable, Codable, CaseIterable { + public enum EnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumStringRequired: String, Sendable, Codable, CaseIterable { + public enum EnumStringRequired: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumInteger: Int, Sendable, Codable, CaseIterable { + public enum EnumInteger: Int, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _1 = 1 case number1 = -1 } - public enum EnumNumber: Double, Sendable, Codable, CaseIterable { + public enum EnumNumber: Double, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _11 = 1.1 case number12 = -1.2 } diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/File.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/File.swift index c35e1b2d53a4..7360adbc0a29 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/File.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/File.swift @@ -8,7 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Sendable, Codable, QueryStringEncodable, Hashable { +public struct File: Sendable, Codable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift index 6ca430a91ba7..54afadae66b5 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct FileSchemaTestClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FileSchemaTestClass: Sendable, Codable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/FormatTest.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/FormatTest.swift index 427b85e7fd9c..fe06e48fa23a 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/FormatTest.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/FormatTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct FormatTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FormatTest: Sendable, Codable, Hashable { public static let integerRule = NumericRule(minimum: 10, exclusiveMinimum: false, maximum: 100, exclusiveMaximum: false, multipleOf: nil) public static let int32Rule = NumericRule(minimum: 20, exclusiveMinimum: false, maximum: 200, exclusiveMaximum: false, multipleOf: nil) diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift index e5db62551691..5b5fe48fb7e5 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct HasOnlyReadOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct HasOnlyReadOnly: Sendable, Codable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/List.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/List.swift index 75c553df8fc5..78e1feb2beff 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/List.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/List.swift @@ -7,7 +7,7 @@ import Foundation -public struct List: Sendable, Codable, QueryStringEncodable, Hashable { +public struct List: Sendable, Codable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/MapTest.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/MapTest.swift index 8cc06717f317..210eef142f1e 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/MapTest.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/MapTest.swift @@ -7,9 +7,9 @@ import Foundation -public struct MapTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MapTest: Sendable, Codable, Hashable { - public enum MapOfEnumString: String, Sendable, Codable, CaseIterable { + public enum MapOfEnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 2c7bd6d9c7c2..06c6a2752677 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Model200Response.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Model200Response.swift index dfe19e3fdd91..aeab3b15a102 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Model200Response.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Model200Response.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Model200Response: Sendable, Codable, Hashable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Name.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Name.swift index d0a98e0980bc..4f6830570025 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Name.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Name.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Name: Sendable, Codable, Hashable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/NumberOnly.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/NumberOnly.swift index 47d2e318bb5a..3621d67757e9 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/NumberOnly.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/NumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct NumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct NumberOnly: Sendable, Codable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Order.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Order.swift index 6a9ecc5540c2..d4bc36f1f897 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Order.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Order.swift @@ -7,9 +7,9 @@ import Foundation -public struct Order: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Order: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/OuterComposite.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/OuterComposite.swift index 0a4d002a2dda..5893a2807418 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/OuterComposite.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/OuterComposite.swift @@ -7,7 +7,7 @@ import Foundation -public struct OuterComposite: Sendable, Codable, QueryStringEncodable, Hashable { +public struct OuterComposite: Sendable, Codable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/OuterEnum.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/OuterEnum.swift index 9bcdaab8b218..3a5e3a720a24 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/OuterEnum.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/OuterEnum.swift @@ -7,7 +7,7 @@ import Foundation -public enum OuterEnum: String, Sendable, Codable, CaseIterable { +public enum OuterEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Pet.swift index 302a3052c6e5..97769ad6256b 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Pet.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Pet.swift @@ -7,9 +7,9 @@ import Foundation -public struct Pet: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Pet: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case available = "available" case pending = "pending" case sold = "sold" diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift index 5a06da436f6a..fd389ad1422d 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift @@ -7,7 +7,7 @@ import Foundation -public struct ReadOnlyFirst: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ReadOnlyFirst: Sendable, Codable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Return.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Return.swift index 53ca3f5ad7f8..2fd94d66e2ab 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Return.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Return.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Return: Sendable, Codable, Hashable { public var _return: Int? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift index 40ad8ff0a055..95c7afe37e25 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift @@ -7,7 +7,7 @@ import Foundation -public struct SpecialModelName: Sendable, Codable, QueryStringEncodable, Hashable { +public struct SpecialModelName: Sendable, Codable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift index 3bbade9feb7b..50ecf3d40383 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift @@ -7,7 +7,7 @@ import Foundation -public struct StringBooleanMap: Sendable, Codable, QueryStringEncodable, Hashable { +public struct StringBooleanMap: Sendable, Codable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Tag.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Tag.swift index 7c19767a11fa..510c09ab0201 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Tag.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Tag.swift @@ -7,7 +7,7 @@ import Foundation -public struct Tag: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Tag: Sendable, Codable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift index eaaab7295001..0824151955c3 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderDefault: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderDefault: Sendable, Codable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift index bac80c4fcd25..437e8d3a7a02 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderExample: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderExample: Sendable, Codable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/User.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/User.swift index e41975d4d669..f012dafe19c6 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/User.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/User.swift @@ -7,7 +7,7 @@ import Foundation -public struct User: Sendable, Codable, QueryStringEncodable, Hashable { +public struct User: Sendable, Codable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 66c40c7cfa11..20e3f2c5f9f9 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -499,8 +499,7 @@ open class FakeAPI { "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -644,8 +643,7 @@ open class FakeAPI { "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ @@ -849,8 +847,7 @@ open class FakeAPI { "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 1e2128072dda..22fc33ee53be 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -460,8 +460,7 @@ open class PetAPI { "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -533,8 +532,7 @@ open class PetAPI { "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -606,8 +604,7 @@ open class PetAPI { "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift index b4218d3375c9..48606ea44cd1 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift @@ -7,8 +7,8 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { - let destination = source.reduce(into: [String: any Sendable]()) { result, item in + public static func rejectNil(_ source: [Key: Value?]) -> [Key: Value]? { + let destination = source.reduce(into: [Key: Value]()) { result, item in if let value = item.value { result[item.key] = value } @@ -20,7 +20,7 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { result, item in if let collection = item.value as? [Any?] { result[item.key] = collection @@ -32,21 +32,6 @@ public struct APIHelper { } } - public static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: any Sendable]()) { result, item in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - } - } - public static func convertAnyToString(_ value: Any?) -> String? { guard let value = value else { return nil } if let value = value as? any RawRepresentable { diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift index 1120f928d7ea..1cd0daecc9f0 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift @@ -9,57 +9,14 @@ import Foundation import FoundationNetworking #endif -extension QueryStringEncodable { - @_disfavoredOverload - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Bool: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Float: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int32: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int64: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Double: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Decimal: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension String: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension URL: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension UUID: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension RawRepresentable where RawValue: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) } +extension RawRepresentable where Self: CustomQueryStringEncodable { + func encodeToQueryString(codableHelper: CodableHelper) -> String { + encodeIfPossible(rawValue, codableHelper: codableHelper) + } } private func encodeIfPossible(_ object: T, codableHelper: CodableHelper) -> String { - if let encodableObject = object as? QueryStringEncodable { + if let encodableObject = object as? any CustomQueryStringEncodable { return encodableObject.encodeToQueryString(codableHelper: codableHelper) } else { return String(describing: object) @@ -88,27 +45,18 @@ extension Dictionary { } } -extension Data: QueryStringEncodable { +extension Data: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } -extension Date: QueryStringEncodable { +extension Date: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return codableHelper.dateFormatter.string(from: self) } } -extension QueryStringEncodable where Self: Encodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { - guard let data = try? codableHelper.jsonEncoder.encode(self) else { - fatalError("Could not encode to json: \(self)") - } - return data.encodeToQueryString(codableHelper: codableHelper) - } -} - extension String: @retroactive CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift index 78a06110af5e..59d2cdf20c67 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift @@ -9,7 +9,7 @@ import Foundation import FoundationNetworking #endif -protocol QueryStringEncodable { +protocol CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String } diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 9bd081f7d001..e15887fc3585 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct AdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct AdditionalPropertiesClass: Sendable, Codable, Hashable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index b20104e0503d..846d0bffd42e 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,7 @@ import Foundation -public struct Animal: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Animal: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index cea25ea52e2f..5f8cfe3d5102 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,7 @@ import Foundation -public struct ApiResponse: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ApiResponse: Sendable, Codable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 679279d61cb8..63dfb69bbabb 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index d71bd4e40b7f..3ed50f5074e1 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 839795229bb7..652ad17e7778 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayTest: Sendable, Codable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 56100523e841..a86eb5e7cc3f 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,7 @@ import Foundation -public struct Capitalization: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Capitalization: Sendable, Codable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index cceeddd1bf93..f4b05d09080b 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,7 @@ import Foundation -public struct Cat: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Cat: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index c04a9e673cf4..64f4cbd29125 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,7 @@ import Foundation -public struct Category: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Category: Sendable, Codable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 4c1e9c1a990b..559a00895906 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ClassModel: Sendable, Codable, Hashable { public var _class: String? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index b49ded4cc5c1..171b4da0eca7 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,7 @@ import Foundation -public struct Client: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Client: Sendable, Codable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 99231ca03f72..d48f9e70e605 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,7 @@ import Foundation -public struct Dog: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Dog: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 09bbcb9f2807..7bd97f59b82e 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,13 +7,13 @@ import Foundation -public struct EnumArrays: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumArrays: Sendable, Codable, Hashable { - public enum JustSymbol: String, Sendable, Codable, CaseIterable { + public enum JustSymbol: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" case dollar = "$" } - public enum ArrayEnum: String, Sendable, Codable, CaseIterable { + public enum ArrayEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case fish = "fish" case crab = "crab" } diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 56823c3a7aa1..b94c29a792cc 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,7 @@ import Foundation -public enum EnumClass: String, Sendable, Codable, CaseIterable { +public enum EnumClass: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" case xyz = "(xyz)" diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index d280112e88b3..9dd889d5fd6c 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,23 +7,23 @@ import Foundation -public struct EnumTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumTest: Sendable, Codable, Hashable { - public enum EnumString: String, Sendable, Codable, CaseIterable { + public enum EnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumStringRequired: String, Sendable, Codable, CaseIterable { + public enum EnumStringRequired: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumInteger: Int, Sendable, Codable, CaseIterable { + public enum EnumInteger: Int, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _1 = 1 case number1 = -1 } - public enum EnumNumber: Double, Sendable, Codable, CaseIterable { + public enum EnumNumber: Double, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _11 = 1.1 case number12 = -1.2 } diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index c35e1b2d53a4..7360adbc0a29 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Sendable, Codable, QueryStringEncodable, Hashable { +public struct File: Sendable, Codable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 6ca430a91ba7..54afadae66b5 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct FileSchemaTestClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FileSchemaTestClass: Sendable, Codable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 427b85e7fd9c..fe06e48fa23a 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct FormatTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FormatTest: Sendable, Codable, Hashable { public static let integerRule = NumericRule(minimum: 10, exclusiveMinimum: false, maximum: 100, exclusiveMaximum: false, multipleOf: nil) public static let int32Rule = NumericRule(minimum: 20, exclusiveMinimum: false, maximum: 200, exclusiveMaximum: false, multipleOf: nil) diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index e5db62551691..5b5fe48fb7e5 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct HasOnlyReadOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct HasOnlyReadOnly: Sendable, Codable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 75c553df8fc5..78e1feb2beff 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,7 @@ import Foundation -public struct List: Sendable, Codable, QueryStringEncodable, Hashable { +public struct List: Sendable, Codable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 8cc06717f317..210eef142f1e 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,9 +7,9 @@ import Foundation -public struct MapTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MapTest: Sendable, Codable, Hashable { - public enum MapOfEnumString: String, Sendable, Codable, CaseIterable { + public enum MapOfEnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 2c7bd6d9c7c2..06c6a2752677 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index dfe19e3fdd91..aeab3b15a102 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Model200Response: Sendable, Codable, Hashable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index d0a98e0980bc..4f6830570025 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Name: Sendable, Codable, Hashable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 47d2e318bb5a..3621d67757e9 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct NumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct NumberOnly: Sendable, Codable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 6a9ecc5540c2..d4bc36f1f897 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,9 @@ import Foundation -public struct Order: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Order: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 0a4d002a2dda..5893a2807418 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,7 @@ import Foundation -public struct OuterComposite: Sendable, Codable, QueryStringEncodable, Hashable { +public struct OuterComposite: Sendable, Codable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9bcdaab8b218..3a5e3a720a24 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,7 @@ import Foundation -public enum OuterEnum: String, Sendable, Codable, CaseIterable { +public enum OuterEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 302a3052c6e5..97769ad6256b 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,9 @@ import Foundation -public struct Pet: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Pet: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case available = "available" case pending = "pending" case sold = "sold" diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 5a06da436f6a..fd389ad1422d 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,7 @@ import Foundation -public struct ReadOnlyFirst: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ReadOnlyFirst: Sendable, Codable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 53ca3f5ad7f8..2fd94d66e2ab 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Return: Sendable, Codable, Hashable { public var _return: Int? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 40ad8ff0a055..95c7afe37e25 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,7 @@ import Foundation -public struct SpecialModelName: Sendable, Codable, QueryStringEncodable, Hashable { +public struct SpecialModelName: Sendable, Codable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3bbade9feb7b..50ecf3d40383 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,7 +7,7 @@ import Foundation -public struct StringBooleanMap: Sendable, Codable, QueryStringEncodable, Hashable { +public struct StringBooleanMap: Sendable, Codable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 7c19767a11fa..510c09ab0201 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,7 @@ import Foundation -public struct Tag: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Tag: Sendable, Codable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index eaaab7295001..0824151955c3 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderDefault: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderDefault: Sendable, Codable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index bac80c4fcd25..437e8d3a7a02 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderExample: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderExample: Sendable, Codable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index e41975d4d669..f012dafe19c6 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,7 @@ import Foundation -public struct User: Sendable, Codable, QueryStringEncodable, Hashable { +public struct User: Sendable, Codable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/FakeAPI.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/FakeAPI.swift index 106c10712e6f..65e1360223c8 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/FakeAPI.swift @@ -483,8 +483,7 @@ open class FakeAPI { "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -626,8 +625,7 @@ open class FakeAPI { "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ @@ -825,8 +823,7 @@ open class FakeAPI { "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/PetAPI.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/PetAPI.swift index c31c5670bc02..1d012d732f13 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/PetAPI.swift @@ -446,8 +446,7 @@ open class PetAPI { "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -517,8 +516,7 @@ open class PetAPI { "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -588,8 +586,7 @@ open class PetAPI { "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIHelper.swift index b4218d3375c9..48606ea44cd1 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/APIHelper.swift @@ -7,8 +7,8 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { - let destination = source.reduce(into: [String: any Sendable]()) { result, item in + public static func rejectNil(_ source: [Key: Value?]) -> [Key: Value]? { + let destination = source.reduce(into: [Key: Value]()) { result, item in if let value = item.value { result[item.key] = value } @@ -20,7 +20,7 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { result, item in if let collection = item.value as? [Any?] { result[item.key] = collection @@ -32,21 +32,6 @@ public struct APIHelper { } } - public static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: any Sendable]()) { result, item in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - } - } - public static func convertAnyToString(_ value: Any?) -> String? { guard let value = value else { return nil } if let value = value as? any RawRepresentable { diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Extensions.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Extensions.swift index 1120f928d7ea..1cd0daecc9f0 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Extensions.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Extensions.swift @@ -9,57 +9,14 @@ import Foundation import FoundationNetworking #endif -extension QueryStringEncodable { - @_disfavoredOverload - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Bool: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Float: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int32: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int64: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Double: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Decimal: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension String: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension URL: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension UUID: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension RawRepresentable where RawValue: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) } +extension RawRepresentable where Self: CustomQueryStringEncodable { + func encodeToQueryString(codableHelper: CodableHelper) -> String { + encodeIfPossible(rawValue, codableHelper: codableHelper) + } } private func encodeIfPossible(_ object: T, codableHelper: CodableHelper) -> String { - if let encodableObject = object as? QueryStringEncodable { + if let encodableObject = object as? any CustomQueryStringEncodable { return encodableObject.encodeToQueryString(codableHelper: codableHelper) } else { return String(describing: object) @@ -88,27 +45,18 @@ extension Dictionary { } } -extension Data: QueryStringEncodable { +extension Data: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } -extension Date: QueryStringEncodable { +extension Date: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return codableHelper.dateFormatter.string(from: self) } } -extension QueryStringEncodable where Self: Encodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { - guard let data = try? codableHelper.jsonEncoder.encode(self) else { - fatalError("Could not encode to json: \(self)") - } - return data.encodeToQueryString(codableHelper: codableHelper) - } -} - extension String: @retroactive CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Models.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Models.swift index 78a06110af5e..59d2cdf20c67 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Infrastructure/Models.swift @@ -9,7 +9,7 @@ import Foundation import FoundationNetworking #endif -protocol QueryStringEncodable { +protocol CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String } diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/AdditionalPropertiesClass.swift index 9bd081f7d001..e15887fc3585 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/AdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct AdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct AdditionalPropertiesClass: Sendable, Codable, Hashable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Animal.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Animal.swift index b20104e0503d..846d0bffd42e 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Animal.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Animal.swift @@ -7,7 +7,7 @@ import Foundation -public struct Animal: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Animal: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ApiResponse.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ApiResponse.swift index cea25ea52e2f..5f8cfe3d5102 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ApiResponse.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ApiResponse.swift @@ -7,7 +7,7 @@ import Foundation -public struct ApiResponse: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ApiResponse: Sendable, Codable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ArrayOfArrayOfNumberOnly.swift index 679279d61cb8..63dfb69bbabb 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ArrayOfNumberOnly.swift index d71bd4e40b7f..3ed50f5074e1 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ArrayTest.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ArrayTest.swift index 839795229bb7..652ad17e7778 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ArrayTest.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ArrayTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayTest: Sendable, Codable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Capitalization.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Capitalization.swift index 56100523e841..a86eb5e7cc3f 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Capitalization.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Capitalization.swift @@ -7,7 +7,7 @@ import Foundation -public struct Capitalization: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Capitalization: Sendable, Codable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Cat.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Cat.swift index cceeddd1bf93..f4b05d09080b 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Cat.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Cat.swift @@ -7,7 +7,7 @@ import Foundation -public struct Cat: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Cat: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Category.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Category.swift index c04a9e673cf4..64f4cbd29125 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Category.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Category.swift @@ -7,7 +7,7 @@ import Foundation -public struct Category: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Category: Sendable, Codable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ClassModel.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ClassModel.swift index 4c1e9c1a990b..559a00895906 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ClassModel.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ClassModel.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ClassModel: Sendable, Codable, Hashable { public var _class: String? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Client.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Client.swift index b49ded4cc5c1..171b4da0eca7 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Client.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Client.swift @@ -7,7 +7,7 @@ import Foundation -public struct Client: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Client: Sendable, Codable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Dog.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Dog.swift index 99231ca03f72..d48f9e70e605 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Dog.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Dog.swift @@ -7,7 +7,7 @@ import Foundation -public struct Dog: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Dog: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/EnumArrays.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/EnumArrays.swift index 09bbcb9f2807..7bd97f59b82e 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/EnumArrays.swift @@ -7,13 +7,13 @@ import Foundation -public struct EnumArrays: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumArrays: Sendable, Codable, Hashable { - public enum JustSymbol: String, Sendable, Codable, CaseIterable { + public enum JustSymbol: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" case dollar = "$" } - public enum ArrayEnum: String, Sendable, Codable, CaseIterable { + public enum ArrayEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case fish = "fish" case crab = "crab" } diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/EnumClass.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/EnumClass.swift index 56823c3a7aa1..b94c29a792cc 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/EnumClass.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/EnumClass.swift @@ -7,7 +7,7 @@ import Foundation -public enum EnumClass: String, Sendable, Codable, CaseIterable { +public enum EnumClass: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" case xyz = "(xyz)" diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/EnumTest.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/EnumTest.swift index d280112e88b3..9dd889d5fd6c 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/EnumTest.swift @@ -7,23 +7,23 @@ import Foundation -public struct EnumTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumTest: Sendable, Codable, Hashable { - public enum EnumString: String, Sendable, Codable, CaseIterable { + public enum EnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumStringRequired: String, Sendable, Codable, CaseIterable { + public enum EnumStringRequired: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumInteger: Int, Sendable, Codable, CaseIterable { + public enum EnumInteger: Int, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _1 = 1 case number1 = -1 } - public enum EnumNumber: Double, Sendable, Codable, CaseIterable { + public enum EnumNumber: Double, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _11 = 1.1 case number12 = -1.2 } diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/File.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/File.swift index c35e1b2d53a4..7360adbc0a29 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/File.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/File.swift @@ -8,7 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Sendable, Codable, QueryStringEncodable, Hashable { +public struct File: Sendable, Codable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/FileSchemaTestClass.swift index 6ca430a91ba7..54afadae66b5 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/FileSchemaTestClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct FileSchemaTestClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FileSchemaTestClass: Sendable, Codable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/FormatTest.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/FormatTest.swift index 427b85e7fd9c..fe06e48fa23a 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/FormatTest.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/FormatTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct FormatTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FormatTest: Sendable, Codable, Hashable { public static let integerRule = NumericRule(minimum: 10, exclusiveMinimum: false, maximum: 100, exclusiveMaximum: false, multipleOf: nil) public static let int32Rule = NumericRule(minimum: 20, exclusiveMinimum: false, maximum: 200, exclusiveMaximum: false, multipleOf: nil) diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/HasOnlyReadOnly.swift index e5db62551691..5b5fe48fb7e5 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/HasOnlyReadOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct HasOnlyReadOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct HasOnlyReadOnly: Sendable, Codable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/List.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/List.swift index 75c553df8fc5..78e1feb2beff 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/List.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/List.swift @@ -7,7 +7,7 @@ import Foundation -public struct List: Sendable, Codable, QueryStringEncodable, Hashable { +public struct List: Sendable, Codable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/MapTest.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/MapTest.swift index 8cc06717f317..210eef142f1e 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/MapTest.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/MapTest.swift @@ -7,9 +7,9 @@ import Foundation -public struct MapTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MapTest: Sendable, Codable, Hashable { - public enum MapOfEnumString: String, Sendable, Codable, CaseIterable { + public enum MapOfEnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 2c7bd6d9c7c2..06c6a2752677 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Model200Response.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Model200Response.swift index dfe19e3fdd91..aeab3b15a102 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Model200Response.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Model200Response.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Model200Response: Sendable, Codable, Hashable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Name.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Name.swift index d0a98e0980bc..4f6830570025 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Name.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Name.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Name: Sendable, Codable, Hashable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/NumberOnly.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/NumberOnly.swift index 47d2e318bb5a..3621d67757e9 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/NumberOnly.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/NumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct NumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct NumberOnly: Sendable, Codable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Order.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Order.swift index 6a9ecc5540c2..d4bc36f1f897 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Order.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Order.swift @@ -7,9 +7,9 @@ import Foundation -public struct Order: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Order: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/OuterComposite.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/OuterComposite.swift index 0a4d002a2dda..5893a2807418 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/OuterComposite.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/OuterComposite.swift @@ -7,7 +7,7 @@ import Foundation -public struct OuterComposite: Sendable, Codable, QueryStringEncodable, Hashable { +public struct OuterComposite: Sendable, Codable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/OuterEnum.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/OuterEnum.swift index 9bcdaab8b218..3a5e3a720a24 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/OuterEnum.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/OuterEnum.swift @@ -7,7 +7,7 @@ import Foundation -public enum OuterEnum: String, Sendable, Codable, CaseIterable { +public enum OuterEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Pet.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Pet.swift index 302a3052c6e5..97769ad6256b 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Pet.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Pet.swift @@ -7,9 +7,9 @@ import Foundation -public struct Pet: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Pet: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case available = "available" case pending = "pending" case sold = "sold" diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ReadOnlyFirst.swift index 5a06da436f6a..fd389ad1422d 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/ReadOnlyFirst.swift @@ -7,7 +7,7 @@ import Foundation -public struct ReadOnlyFirst: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ReadOnlyFirst: Sendable, Codable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Return.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Return.swift index 53ca3f5ad7f8..2fd94d66e2ab 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Return.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Return.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Return: Sendable, Codable, Hashable { public var _return: Int? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/SpecialModelName.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/SpecialModelName.swift index 40ad8ff0a055..95c7afe37e25 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/SpecialModelName.swift @@ -7,7 +7,7 @@ import Foundation -public struct SpecialModelName: Sendable, Codable, QueryStringEncodable, Hashable { +public struct SpecialModelName: Sendable, Codable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/StringBooleanMap.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/StringBooleanMap.swift index 3bbade9feb7b..50ecf3d40383 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/StringBooleanMap.swift @@ -7,7 +7,7 @@ import Foundation -public struct StringBooleanMap: Sendable, Codable, QueryStringEncodable, Hashable { +public struct StringBooleanMap: Sendable, Codable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Tag.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Tag.swift index 7c19767a11fa..510c09ab0201 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Tag.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Tag.swift @@ -7,7 +7,7 @@ import Foundation -public struct Tag: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Tag: Sendable, Codable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/TypeHolderDefault.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/TypeHolderDefault.swift index eaaab7295001..0824151955c3 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/TypeHolderDefault.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderDefault: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderDefault: Sendable, Codable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/TypeHolderExample.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/TypeHolderExample.swift index bac80c4fcd25..437e8d3a7a02 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/TypeHolderExample.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderExample: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderExample: Sendable, Codable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/User.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/User.swift index e41975d4d669..f012dafe19c6 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/User.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/User.swift @@ -7,7 +7,7 @@ import Foundation -public struct User: Sendable, Codable, QueryStringEncodable, Hashable { +public struct User: Sendable, Codable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift index f48558e30aba..2da258a434b7 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -374,8 +374,7 @@ open class FakeAPI { "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -499,8 +498,7 @@ open class FakeAPI { "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ @@ -644,8 +642,7 @@ open class FakeAPI { "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift index 04d43062920a..aeb57c47afe3 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift @@ -314,8 +314,7 @@ open class PetAPI { "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -367,8 +366,7 @@ open class PetAPI { "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -420,8 +418,7 @@ open class PetAPI { "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIHelper.swift index b4218d3375c9..48606ea44cd1 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/APIHelper.swift @@ -7,8 +7,8 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { - let destination = source.reduce(into: [String: any Sendable]()) { result, item in + public static func rejectNil(_ source: [Key: Value?]) -> [Key: Value]? { + let destination = source.reduce(into: [Key: Value]()) { result, item in if let value = item.value { result[item.key] = value } @@ -20,7 +20,7 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { result, item in if let collection = item.value as? [Any?] { result[item.key] = collection @@ -32,21 +32,6 @@ public struct APIHelper { } } - public static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: any Sendable]()) { result, item in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - } - } - public static func convertAnyToString(_ value: Any?) -> String? { guard let value = value else { return nil } if let value = value as? any RawRepresentable { diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Extensions.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Extensions.swift index 1120f928d7ea..1cd0daecc9f0 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Extensions.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Extensions.swift @@ -9,57 +9,14 @@ import Foundation import FoundationNetworking #endif -extension QueryStringEncodable { - @_disfavoredOverload - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Bool: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Float: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int32: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int64: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Double: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Decimal: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension String: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension URL: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension UUID: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension RawRepresentable where RawValue: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) } +extension RawRepresentable where Self: CustomQueryStringEncodable { + func encodeToQueryString(codableHelper: CodableHelper) -> String { + encodeIfPossible(rawValue, codableHelper: codableHelper) + } } private func encodeIfPossible(_ object: T, codableHelper: CodableHelper) -> String { - if let encodableObject = object as? QueryStringEncodable { + if let encodableObject = object as? any CustomQueryStringEncodable { return encodableObject.encodeToQueryString(codableHelper: codableHelper) } else { return String(describing: object) @@ -88,27 +45,18 @@ extension Dictionary { } } -extension Data: QueryStringEncodable { +extension Data: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } -extension Date: QueryStringEncodable { +extension Date: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return codableHelper.dateFormatter.string(from: self) } } -extension QueryStringEncodable where Self: Encodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { - guard let data = try? codableHelper.jsonEncoder.encode(self) else { - fatalError("Could not encode to json: \(self)") - } - return data.encodeToQueryString(codableHelper: codableHelper) - } -} - extension String: @retroactive CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Models.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Models.swift index 78a06110af5e..59d2cdf20c67 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Infrastructure/Models.swift @@ -9,7 +9,7 @@ import Foundation import FoundationNetworking #endif -protocol QueryStringEncodable { +protocol CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String } diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift index b196dcd18bc4..73af7c62a61e 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesAnyType.swift @@ -7,7 +7,7 @@ import Foundation -public struct AdditionalPropertiesAnyType: Sendable, Codable, QueryStringEncodable, Hashable { +public struct AdditionalPropertiesAnyType: Sendable, Codable, Hashable { public var name: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift index bf92db2adb81..2f347ca1c8e6 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesArray.swift @@ -7,7 +7,7 @@ import Foundation -public struct AdditionalPropertiesArray: Sendable, Codable, QueryStringEncodable, Hashable { +public struct AdditionalPropertiesArray: Sendable, Codable, Hashable { public var name: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift index 844686f06ca6..b49767cdd8d4 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesBoolean.swift @@ -7,7 +7,7 @@ import Foundation -public struct AdditionalPropertiesBoolean: Sendable, Codable, QueryStringEncodable, Hashable { +public struct AdditionalPropertiesBoolean: Sendable, Codable, Hashable { public var name: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift index 2cab8f056446..225ae4672d1f 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct AdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct AdditionalPropertiesClass: Sendable, Codable, Hashable { public var mapString: [String: String]? public var mapNumber: [String: Double]? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift index 08efb93d2040..c2e8eb2e48d2 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesInteger.swift @@ -7,7 +7,7 @@ import Foundation -public struct AdditionalPropertiesInteger: Sendable, Codable, QueryStringEncodable, Hashable { +public struct AdditionalPropertiesInteger: Sendable, Codable, Hashable { public var name: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift index ce1fd377f2a5..436216e5e5b9 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesNumber.swift @@ -7,7 +7,7 @@ import Foundation -public struct AdditionalPropertiesNumber: Sendable, Codable, QueryStringEncodable, Hashable { +public struct AdditionalPropertiesNumber: Sendable, Codable, Hashable { public var name: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift index d46086c877b5..621754061f39 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesObject.swift @@ -7,7 +7,7 @@ import Foundation -public struct AdditionalPropertiesObject: Sendable, Codable, QueryStringEncodable, Hashable { +public struct AdditionalPropertiesObject: Sendable, Codable, Hashable { public var name: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift index 75d613e8086d..9108687309a1 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/AdditionalPropertiesString.swift @@ -7,7 +7,7 @@ import Foundation -public struct AdditionalPropertiesString: Sendable, Codable, QueryStringEncodable, Hashable { +public struct AdditionalPropertiesString: Sendable, Codable, Hashable { public var name: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Animal.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Animal.swift index b20104e0503d..846d0bffd42e 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Animal.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Animal.swift @@ -7,7 +7,7 @@ import Foundation -public struct Animal: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Animal: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ApiResponse.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ApiResponse.swift index cea25ea52e2f..5f8cfe3d5102 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ApiResponse.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ApiResponse.swift @@ -7,7 +7,7 @@ import Foundation -public struct ApiResponse: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ApiResponse: Sendable, Codable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift index 679279d61cb8..63dfb69bbabb 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift index d71bd4e40b7f..3ed50f5074e1 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ArrayTest.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ArrayTest.swift index 839795229bb7..652ad17e7778 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ArrayTest.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ArrayTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayTest: Sendable, Codable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/BigCat.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/BigCat.swift index 889e21b530b3..49d6ce3dc6f0 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/BigCat.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/BigCat.swift @@ -7,9 +7,9 @@ import Foundation -public struct BigCat: Sendable, Codable, QueryStringEncodable, Hashable { +public struct BigCat: Sendable, Codable, Hashable { - public enum Kind: String, Sendable, Codable, CaseIterable { + public enum Kind: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case lions = "lions" case tigers = "tigers" case leopards = "leopards" diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Capitalization.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Capitalization.swift index 56100523e841..a86eb5e7cc3f 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Capitalization.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Capitalization.swift @@ -7,7 +7,7 @@ import Foundation -public struct Capitalization: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Capitalization: Sendable, Codable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Cat.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Cat.swift index cceeddd1bf93..f4b05d09080b 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Cat.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Cat.swift @@ -7,7 +7,7 @@ import Foundation -public struct Cat: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Cat: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Category.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Category.swift index e83ecfd44a0f..43c83629acd6 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Category.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Category.swift @@ -7,7 +7,7 @@ import Foundation -public struct Category: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Category: Sendable, Codable, Hashable { public var id: Int64? public var name: String = "default-name" diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ClassModel.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ClassModel.swift index 4c1e9c1a990b..559a00895906 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ClassModel.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ClassModel.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ClassModel: Sendable, Codable, Hashable { public var _class: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Client.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Client.swift index b49ded4cc5c1..171b4da0eca7 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Client.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Client.swift @@ -7,7 +7,7 @@ import Foundation -public struct Client: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Client: Sendable, Codable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Dog.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Dog.swift index 99231ca03f72..d48f9e70e605 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Dog.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Dog.swift @@ -7,7 +7,7 @@ import Foundation -public struct Dog: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Dog: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/EnumArrays.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/EnumArrays.swift index 09bbcb9f2807..7bd97f59b82e 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/EnumArrays.swift @@ -7,13 +7,13 @@ import Foundation -public struct EnumArrays: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumArrays: Sendable, Codable, Hashable { - public enum JustSymbol: String, Sendable, Codable, CaseIterable { + public enum JustSymbol: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" case dollar = "$" } - public enum ArrayEnum: String, Sendable, Codable, CaseIterable { + public enum ArrayEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case fish = "fish" case crab = "crab" } diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/EnumClass.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/EnumClass.swift index 56823c3a7aa1..b94c29a792cc 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/EnumClass.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/EnumClass.swift @@ -7,7 +7,7 @@ import Foundation -public enum EnumClass: String, Sendable, Codable, CaseIterable { +public enum EnumClass: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" case xyz = "(xyz)" diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/EnumTest.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/EnumTest.swift index d280112e88b3..9dd889d5fd6c 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/EnumTest.swift @@ -7,23 +7,23 @@ import Foundation -public struct EnumTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumTest: Sendable, Codable, Hashable { - public enum EnumString: String, Sendable, Codable, CaseIterable { + public enum EnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumStringRequired: String, Sendable, Codable, CaseIterable { + public enum EnumStringRequired: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumInteger: Int, Sendable, Codable, CaseIterable { + public enum EnumInteger: Int, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _1 = 1 case number1 = -1 } - public enum EnumNumber: Double, Sendable, Codable, CaseIterable { + public enum EnumNumber: Double, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _11 = 1.1 case number12 = -1.2 } diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/File.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/File.swift index c35e1b2d53a4..7360adbc0a29 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/File.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/File.swift @@ -8,7 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Sendable, Codable, QueryStringEncodable, Hashable { +public struct File: Sendable, Codable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/FileSchemaTestClass.swift index 6ca430a91ba7..54afadae66b5 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/FileSchemaTestClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct FileSchemaTestClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FileSchemaTestClass: Sendable, Codable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/FormatTest.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/FormatTest.swift index 61e17db120ba..79488497d087 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/FormatTest.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/FormatTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct FormatTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FormatTest: Sendable, Codable, Hashable { public static let integerRule = NumericRule(minimum: 10, exclusiveMinimum: false, maximum: 100, exclusiveMaximum: false, multipleOf: nil) public static let int32Rule = NumericRule(minimum: 20, exclusiveMinimum: false, maximum: 200, exclusiveMaximum: false, multipleOf: nil) diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift index e5db62551691..5b5fe48fb7e5 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct HasOnlyReadOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct HasOnlyReadOnly: Sendable, Codable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/List.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/List.swift index 75c553df8fc5..78e1feb2beff 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/List.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/List.swift @@ -7,7 +7,7 @@ import Foundation -public struct List: Sendable, Codable, QueryStringEncodable, Hashable { +public struct List: Sendable, Codable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/MapTest.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/MapTest.swift index 8cc06717f317..210eef142f1e 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/MapTest.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/MapTest.swift @@ -7,9 +7,9 @@ import Foundation -public struct MapTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MapTest: Sendable, Codable, Hashable { - public enum MapOfEnumString: String, Sendable, Codable, CaseIterable { + public enum MapOfEnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 2c7bd6d9c7c2..06c6a2752677 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Model200Response.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Model200Response.swift index dfe19e3fdd91..aeab3b15a102 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Model200Response.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Model200Response.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Model200Response: Sendable, Codable, Hashable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Name.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Name.swift index 74c87a00de3a..9db2b38be89b 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Name.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Name.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Name: Sendable, Codable, Hashable { public var name: Int public var snakeCase: Int? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/NumberOnly.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/NumberOnly.swift index 47d2e318bb5a..3621d67757e9 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/NumberOnly.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/NumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct NumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct NumberOnly: Sendable, Codable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Order.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Order.swift index 2e677b9763d9..d02659b41252 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Order.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Order.swift @@ -7,9 +7,9 @@ import Foundation -public struct Order: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Order: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case shipped = "delivered" diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/OuterComposite.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/OuterComposite.swift index 0a4d002a2dda..5893a2807418 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/OuterComposite.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/OuterComposite.swift @@ -7,7 +7,7 @@ import Foundation -public struct OuterComposite: Sendable, Codable, QueryStringEncodable, Hashable { +public struct OuterComposite: Sendable, Codable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/OuterEnum.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/OuterEnum.swift index 53aedf4e9c0e..fabfe42a1f70 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/OuterEnum.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/OuterEnum.swift @@ -7,7 +7,7 @@ import Foundation -public enum OuterEnum: String, Sendable, Codable, CaseIterable { +public enum OuterEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case shipped = "delivered" diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Pet.swift index 15b7f089a744..1e6f6906fe02 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Pet.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Pet.swift @@ -7,9 +7,9 @@ import Foundation -public struct Pet: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Pet: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case available = "available" case pending = "pending" case sold = "sold" diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ReadOnlyFirst.swift index 5a06da436f6a..fd389ad1422d 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/ReadOnlyFirst.swift @@ -7,7 +7,7 @@ import Foundation -public struct ReadOnlyFirst: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ReadOnlyFirst: Sendable, Codable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Return.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Return.swift index 53ca3f5ad7f8..2fd94d66e2ab 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Return.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Return.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Return: Sendable, Codable, Hashable { public var _return: Int? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/SpecialModelName.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/SpecialModelName.swift index 40ad8ff0a055..95c7afe37e25 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/SpecialModelName.swift @@ -7,7 +7,7 @@ import Foundation -public struct SpecialModelName: Sendable, Codable, QueryStringEncodable, Hashable { +public struct SpecialModelName: Sendable, Codable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/StringBooleanMap.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/StringBooleanMap.swift index 3bbade9feb7b..50ecf3d40383 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/StringBooleanMap.swift @@ -7,7 +7,7 @@ import Foundation -public struct StringBooleanMap: Sendable, Codable, QueryStringEncodable, Hashable { +public struct StringBooleanMap: Sendable, Codable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Tag.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Tag.swift index 7c19767a11fa..510c09ab0201 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Tag.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Tag.swift @@ -7,7 +7,7 @@ import Foundation -public struct Tag: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Tag: Sendable, Codable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/TypeHolderDefault.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/TypeHolderDefault.swift index eaaab7295001..0824151955c3 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/TypeHolderDefault.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderDefault: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderDefault: Sendable, Codable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/TypeHolderExample.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/TypeHolderExample.swift index bc28c84984ab..a74e310e0750 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/TypeHolderExample.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderExample: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderExample: Sendable, Codable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/User.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/User.swift index e41975d4d669..f012dafe19c6 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/User.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/User.swift @@ -7,7 +7,7 @@ import Foundation -public struct User: Sendable, Codable, QueryStringEncodable, Hashable { +public struct User: Sendable, Codable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/XmlItem.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/XmlItem.swift index 2483cb03e275..e05318fb7e24 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/XmlItem.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/XmlItem.swift @@ -7,7 +7,7 @@ import Foundation -public struct XmlItem: Sendable, Codable, QueryStringEncodable, Hashable { +public struct XmlItem: Sendable, Codable, Hashable { public var attributeString: String? public var attributeNumber: Double? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/FakeAPI.swift index 915a19c96a4e..5f792648b259 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -392,8 +392,7 @@ import Foundation "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -524,8 +523,7 @@ import Foundation "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ @@ -690,8 +688,7 @@ import Foundation "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/PetAPI.swift index ef7aa107f0af..29a1588f4b14 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/PetAPI.swift @@ -366,8 +366,7 @@ import Foundation "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -426,8 +425,7 @@ import Foundation "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -486,8 +484,7 @@ import Foundation "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIHelper.swift index b4218d3375c9..48606ea44cd1 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/APIHelper.swift @@ -7,8 +7,8 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { - let destination = source.reduce(into: [String: any Sendable]()) { result, item in + public static func rejectNil(_ source: [Key: Value?]) -> [Key: Value]? { + let destination = source.reduce(into: [Key: Value]()) { result, item in if let value = item.value { result[item.key] = value } @@ -20,7 +20,7 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { result, item in if let collection = item.value as? [Any?] { result[item.key] = collection @@ -32,21 +32,6 @@ public struct APIHelper { } } - public static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: any Sendable]()) { result, item in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - } - } - public static func convertAnyToString(_ value: Any?) -> String? { guard let value = value else { return nil } if let value = value as? any RawRepresentable { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Extensions.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Extensions.swift index 1120f928d7ea..1cd0daecc9f0 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Extensions.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Extensions.swift @@ -9,57 +9,14 @@ import Foundation import FoundationNetworking #endif -extension QueryStringEncodable { - @_disfavoredOverload - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Bool: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Float: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int32: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int64: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Double: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Decimal: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension String: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension URL: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension UUID: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension RawRepresentable where RawValue: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) } +extension RawRepresentable where Self: CustomQueryStringEncodable { + func encodeToQueryString(codableHelper: CodableHelper) -> String { + encodeIfPossible(rawValue, codableHelper: codableHelper) + } } private func encodeIfPossible(_ object: T, codableHelper: CodableHelper) -> String { - if let encodableObject = object as? QueryStringEncodable { + if let encodableObject = object as? any CustomQueryStringEncodable { return encodableObject.encodeToQueryString(codableHelper: codableHelper) } else { return String(describing: object) @@ -88,27 +45,18 @@ extension Dictionary { } } -extension Data: QueryStringEncodable { +extension Data: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } -extension Date: QueryStringEncodable { +extension Date: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return codableHelper.dateFormatter.string(from: self) } } -extension QueryStringEncodable where Self: Encodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { - guard let data = try? codableHelper.jsonEncoder.encode(self) else { - fatalError("Could not encode to json: \(self)") - } - return data.encodeToQueryString(codableHelper: codableHelper) - } -} - extension String: @retroactive CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Models.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Models.swift index 78a06110af5e..59d2cdf20c67 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Infrastructure/Models.swift @@ -9,7 +9,7 @@ import Foundation import FoundationNetworking #endif -protocol QueryStringEncodable { +protocol CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String } diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift index ff43a4268404..67363bd51bb6 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class AdditionalPropertiesClass: NSObject, Codable, QueryStringEncodable { +@objcMembers public class AdditionalPropertiesClass: NSObject, Codable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Animal.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Animal.swift index d7b9f602323e..73979b9c7dfa 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Animal.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Animal.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Animal: NSObject, Codable, QueryStringEncodable { +@objcMembers public class Animal: NSObject, Codable { public var _className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ApiResponse.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ApiResponse.swift index 5e4e0c36d7c1..99c3cc011f9a 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ApiResponse.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ApiResponse.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class ApiResponse: NSObject, Codable, QueryStringEncodable { +@objcMembers public class ApiResponse: NSObject, Codable { public var code: Int? public var codeNum: NSNumber? { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift index 24f978b3accc..d99f7676974d 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class ArrayOfArrayOfNumberOnly: NSObject, Codable, QueryStringEncodable { +@objcMembers public class ArrayOfArrayOfNumberOnly: NSObject, Codable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift index 87976a6bc10c..8995bbdf2d72 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class ArrayOfNumberOnly: NSObject, Codable, QueryStringEncodable { +@objcMembers public class ArrayOfNumberOnly: NSObject, Codable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayTest.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayTest.swift index 9df6854ecd38..03e4b517b264 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayTest.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ArrayTest.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class ArrayTest: NSObject, Codable, QueryStringEncodable { +@objcMembers public class ArrayTest: NSObject, Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Capitalization.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Capitalization.swift index 2862c6d836e3..c37099bfb486 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Capitalization.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Capitalization.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Capitalization: NSObject, Codable, QueryStringEncodable { +@objcMembers public class Capitalization: NSObject, Codable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Cat.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Cat.swift index 7d93c0dd084b..4c5ac7fbc90a 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Cat.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Cat.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Cat: NSObject, Codable, QueryStringEncodable { +@objcMembers public class Cat: NSObject, Codable { public var _className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Category.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Category.swift index 8801788d3b76..96fcaff3d401 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Category.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Category.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Category: NSObject, Codable, QueryStringEncodable { +@objcMembers public class Category: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ClassModel.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ClassModel.swift index 42274044f195..4978f212ac10 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ClassModel.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ClassModel.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -@objcMembers public class ClassModel: NSObject, Codable, QueryStringEncodable { +@objcMembers public class ClassModel: NSObject, Codable { public var _class: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Client.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Client.swift index c6140e4e15ed..dbad08f4cee0 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Client.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Client.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Client: NSObject, Codable, QueryStringEncodable { +@objcMembers public class Client: NSObject, Codable { public var client: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Dog.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Dog.swift index 32f8957fe735..972028f8d87b 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Dog.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Dog.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Dog: NSObject, Codable, QueryStringEncodable { +@objcMembers public class Dog: NSObject, Codable { public var _className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumArrays.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumArrays.swift index 53d96d689f68..2d3d81d3ee0b 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumArrays.swift @@ -7,13 +7,13 @@ import Foundation -@objcMembers public class EnumArrays: NSObject, Codable, QueryStringEncodable { +@objcMembers public class EnumArrays: NSObject, Codable { - public enum JustSymbol: String, Sendable, Codable, CaseIterable { + public enum JustSymbol: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" case dollar = "$" } - public enum ArrayEnum: String, Sendable, Codable, CaseIterable { + public enum ArrayEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case fish = "fish" case crab = "crab" } diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumClass.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumClass.swift index 56823c3a7aa1..b94c29a792cc 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumClass.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumClass.swift @@ -7,7 +7,7 @@ import Foundation -public enum EnumClass: String, Sendable, Codable, CaseIterable { +public enum EnumClass: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" case xyz = "(xyz)" diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumTest.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumTest.swift index 42043815934d..cd9681060be5 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/EnumTest.swift @@ -7,23 +7,23 @@ import Foundation -@objcMembers public class EnumTest: NSObject, Codable, QueryStringEncodable { +@objcMembers public class EnumTest: NSObject, Codable { - public enum EnumString: String, Sendable, Codable, CaseIterable { + public enum EnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumStringRequired: String, Sendable, Codable, CaseIterable { + public enum EnumStringRequired: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumInteger: Int, Sendable, Codable, CaseIterable { + public enum EnumInteger: Int, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _1 = 1 case number1 = -1 } - public enum EnumNumber: Double, Sendable, Codable, CaseIterable { + public enum EnumNumber: Double, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _11 = 1.1 case number12 = -1.2 } diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/File.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/File.swift index 16d025d2d12a..c8cb3ec9ca5a 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/File.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/File.swift @@ -8,7 +8,7 @@ import Foundation /** Must be named `File` for test. */ -@objcMembers public class File: NSObject, Codable, QueryStringEncodable { +@objcMembers public class File: NSObject, Codable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FileSchemaTestClass.swift index 0761749c34bd..678e7dc717e2 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FileSchemaTestClass.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class FileSchemaTestClass: NSObject, Codable, QueryStringEncodable { +@objcMembers public class FileSchemaTestClass: NSObject, Codable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FormatTest.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FormatTest.swift index c0e14f2e063f..2a229371bf2e 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FormatTest.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/FormatTest.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class FormatTest: NSObject, Codable, QueryStringEncodable { +@objcMembers public class FormatTest: NSObject, Codable { public static let integerRule = NumericRule(minimum: 10, exclusiveMinimum: false, maximum: 100, exclusiveMaximum: false, multipleOf: nil) public static let int32Rule = NumericRule(minimum: 20, exclusiveMinimum: false, maximum: 200, exclusiveMaximum: false, multipleOf: nil) diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift index fde651257f98..5539b28b047e 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class HasOnlyReadOnly: NSObject, Codable, QueryStringEncodable { +@objcMembers public class HasOnlyReadOnly: NSObject, Codable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/List.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/List.swift index ac9b2ddf8679..437e6e295793 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/List.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/List.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class List: NSObject, Codable, QueryStringEncodable { +@objcMembers public class List: NSObject, Codable { public var _123list: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MapTest.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MapTest.swift index 1d9d0ad9324d..9d2df953f3b3 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MapTest.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MapTest.swift @@ -7,9 +7,9 @@ import Foundation -@objcMembers public class MapTest: NSObject, Codable, QueryStringEncodable { +@objcMembers public class MapTest: NSObject, Codable { - public enum MapOfEnumString: String, Sendable, Codable, CaseIterable { + public enum MapOfEnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index f566d6af6885..3c209dadf694 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable, QueryStringEncodable { +@objcMembers public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Model200Response.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Model200Response.swift index 37c35576bf1b..01417dc973db 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Model200Response.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Model200Response.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -@objcMembers public class Model200Response: NSObject, Codable, QueryStringEncodable { +@objcMembers public class Model200Response: NSObject, Codable { public var name: Int? public var nameNum: NSNumber? { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Name.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Name.swift index 9c783ca18521..ea194f23abe9 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Name.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Name.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -@objcMembers public class Name: NSObject, Codable, QueryStringEncodable { +@objcMembers public class Name: NSObject, Codable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/NumberOnly.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/NumberOnly.swift index 4a019233c1af..0bf7187db5ab 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/NumberOnly.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/NumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class NumberOnly: NSObject, Codable, QueryStringEncodable { +@objcMembers public class NumberOnly: NSObject, Codable { public var justNumber: Double? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Order.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Order.swift index 8b9ca0f6b3d8..18b44f6ef614 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Order.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Order.swift @@ -7,9 +7,9 @@ import Foundation -@objcMembers public class Order: NSObject, Codable, QueryStringEncodable { +@objcMembers public class Order: NSObject, Codable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/OuterComposite.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/OuterComposite.swift index 8ef5bf313608..6eecc41fd8b2 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/OuterComposite.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/OuterComposite.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class OuterComposite: NSObject, Codable, QueryStringEncodable { +@objcMembers public class OuterComposite: NSObject, Codable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/OuterEnum.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/OuterEnum.swift index 9bcdaab8b218..3a5e3a720a24 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/OuterEnum.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/OuterEnum.swift @@ -7,7 +7,7 @@ import Foundation -public enum OuterEnum: String, Sendable, Codable, CaseIterable { +public enum OuterEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Pet.swift index fc85d0a35167..79ab8f8ad622 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Pet.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Pet.swift @@ -7,9 +7,9 @@ import Foundation -@objcMembers public class Pet: NSObject, Codable, QueryStringEncodable { +@objcMembers public class Pet: NSObject, Codable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case available = "available" case pending = "pending" case sold = "sold" diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ReadOnlyFirst.swift index e80c59d32731..e7df6a5b1164 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/ReadOnlyFirst.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class ReadOnlyFirst: NSObject, Codable, QueryStringEncodable { +@objcMembers public class ReadOnlyFirst: NSObject, Codable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Return.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Return.swift index 2fd051f925ed..d832278eb61f 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Return.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Return.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing reserved words */ -@objcMembers public class Return: NSObject, Codable, QueryStringEncodable { +@objcMembers public class Return: NSObject, Codable { public var _return: Int? public var _returnNum: NSNumber? { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/SpecialModelName.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/SpecialModelName.swift index bce626c79e7b..33a6e621028c 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/SpecialModelName.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class SpecialModelName: NSObject, Codable, QueryStringEncodable { +@objcMembers public class SpecialModelName: NSObject, Codable { public var specialPropertyName: Int64? public var specialPropertyNameNum: NSNumber? { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/StringBooleanMap.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/StringBooleanMap.swift index de0825caaee3..a3240d3e3724 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/StringBooleanMap.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class StringBooleanMap: NSObject, Codable, QueryStringEncodable { +@objcMembers public class StringBooleanMap: NSObject, Codable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Tag.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Tag.swift index f7670114e760..51a4111dbce4 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Tag.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/Tag.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class Tag: NSObject, Codable, QueryStringEncodable { +@objcMembers public class Tag: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderDefault.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderDefault.swift index 093c4131d0c2..c5f3a002a8ad 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderDefault.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class TypeHolderDefault: NSObject, Codable, QueryStringEncodable { +@objcMembers public class TypeHolderDefault: NSObject, Codable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderExample.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderExample.swift index 406aa05eba23..36ddbd26f366 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/TypeHolderExample.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class TypeHolderExample: NSObject, Codable, QueryStringEncodable { +@objcMembers public class TypeHolderExample: NSObject, Codable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/User.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/User.swift index 4ad13fce2348..434186d6edb2 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/User.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/Models/User.swift @@ -7,7 +7,7 @@ import Foundation -@objcMembers public class User: NSObject, Codable, QueryStringEncodable { +@objcMembers public class User: NSObject, Codable { public var _id: Int64? public var _idNum: NSNumber? { diff --git a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift index b4218d3375c9..48606ea44cd1 100644 --- a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift @@ -7,8 +7,8 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { - let destination = source.reduce(into: [String: any Sendable]()) { result, item in + public static func rejectNil(_ source: [Key: Value?]) -> [Key: Value]? { + let destination = source.reduce(into: [Key: Value]()) { result, item in if let value = item.value { result[item.key] = value } @@ -20,7 +20,7 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { result, item in if let collection = item.value as? [Any?] { result[item.key] = collection @@ -32,21 +32,6 @@ public struct APIHelper { } } - public static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: any Sendable]()) { result, item in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - } - } - public static func convertAnyToString(_ value: Any?) -> String? { guard let value = value else { return nil } if let value = value as? any RawRepresentable { diff --git a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift index 1120f928d7ea..1cd0daecc9f0 100644 --- a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift +++ b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift @@ -9,57 +9,14 @@ import Foundation import FoundationNetworking #endif -extension QueryStringEncodable { - @_disfavoredOverload - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Bool: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Float: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int32: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int64: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Double: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Decimal: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension String: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension URL: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension UUID: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension RawRepresentable where RawValue: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) } +extension RawRepresentable where Self: CustomQueryStringEncodable { + func encodeToQueryString(codableHelper: CodableHelper) -> String { + encodeIfPossible(rawValue, codableHelper: codableHelper) + } } private func encodeIfPossible(_ object: T, codableHelper: CodableHelper) -> String { - if let encodableObject = object as? QueryStringEncodable { + if let encodableObject = object as? any CustomQueryStringEncodable { return encodableObject.encodeToQueryString(codableHelper: codableHelper) } else { return String(describing: object) @@ -88,27 +45,18 @@ extension Dictionary { } } -extension Data: QueryStringEncodable { +extension Data: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } -extension Date: QueryStringEncodable { +extension Date: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return codableHelper.dateFormatter.string(from: self) } } -extension QueryStringEncodable where Self: Encodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { - guard let data = try? codableHelper.jsonEncoder.encode(self) else { - fatalError("Could not encode to json: \(self)") - } - return data.encodeToQueryString(codableHelper: codableHelper) - } -} - extension String: @retroactive CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift index 78a06110af5e..59d2cdf20c67 100644 --- a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift @@ -9,7 +9,7 @@ import Foundation import FoundationNetworking #endif -protocol QueryStringEncodable { +protocol CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String } diff --git a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Apple.swift b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Apple.swift index b5f9dab002a3..df4ed00e2665 100644 --- a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Apple.swift +++ b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Apple.swift @@ -7,7 +7,7 @@ import Foundation -public struct Apple: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Apple: Sendable, Codable, Hashable { public var kind: String? diff --git a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift index fa52f03497fc..85850cf42421 100644 --- a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift +++ b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift @@ -7,7 +7,7 @@ import Foundation -public struct Banana: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Banana: Sendable, Codable, Hashable { public var count: Double? diff --git a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Fruit.swift b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Fruit.swift index bff766489aa5..14ab723afe30 100644 --- a/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Fruit.swift +++ b/samples/client/petstore/swift6/oneOf/PetstoreClient/Classes/OpenAPIs/Models/Fruit.swift @@ -7,7 +7,7 @@ import Foundation -public enum Fruit: Sendable, Codable, QueryStringEncodable, Hashable { +public enum Fruit: Sendable, Codable, Hashable { case typeApple(Apple) case typeBanana(Banana) diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 3b2dbbfd0cd9..a13ed0afbebb 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -401,8 +401,7 @@ open class FakeAPI { "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -534,8 +533,7 @@ open class FakeAPI { "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ @@ -703,8 +701,7 @@ open class FakeAPI { "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index f862792ac8f8..13359e61373c 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -374,8 +374,7 @@ open class PetAPI { "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -435,8 +434,7 @@ open class PetAPI { "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -496,8 +494,7 @@ open class PetAPI { "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift index b4218d3375c9..48606ea44cd1 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift @@ -7,8 +7,8 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { - let destination = source.reduce(into: [String: any Sendable]()) { result, item in + public static func rejectNil(_ source: [Key: Value?]) -> [Key: Value]? { + let destination = source.reduce(into: [Key: Value]()) { result, item in if let value = item.value { result[item.key] = value } @@ -20,7 +20,7 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { result, item in if let collection = item.value as? [Any?] { result[item.key] = collection @@ -32,21 +32,6 @@ public struct APIHelper { } } - public static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: any Sendable]()) { result, item in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - } - } - public static func convertAnyToString(_ value: Any?) -> String? { guard let value = value else { return nil } if let value = value as? any RawRepresentable { diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift index 74e95feeeedb..aff7cbf88c3a 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift @@ -10,57 +10,14 @@ import FoundationNetworking #endif @preconcurrency import PromiseKit -extension QueryStringEncodable { - @_disfavoredOverload - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Bool: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Float: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int32: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int64: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Double: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Decimal: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension String: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension URL: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension UUID: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension RawRepresentable where RawValue: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) } +extension RawRepresentable where Self: CustomQueryStringEncodable { + func encodeToQueryString(codableHelper: CodableHelper) -> String { + encodeIfPossible(rawValue, codableHelper: codableHelper) + } } private func encodeIfPossible(_ object: T, codableHelper: CodableHelper) -> String { - if let encodableObject = object as? QueryStringEncodable { + if let encodableObject = object as? any CustomQueryStringEncodable { return encodableObject.encodeToQueryString(codableHelper: codableHelper) } else { return String(describing: object) @@ -89,27 +46,18 @@ extension Dictionary { } } -extension Data: QueryStringEncodable { +extension Data: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } -extension Date: QueryStringEncodable { +extension Date: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return codableHelper.dateFormatter.string(from: self) } } -extension QueryStringEncodable where Self: Encodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { - guard let data = try? codableHelper.jsonEncoder.encode(self) else { - fatalError("Could not encode to json: \(self)") - } - return data.encodeToQueryString(codableHelper: codableHelper) - } -} - extension String: @retroactive CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift index 78a06110af5e..59d2cdf20c67 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift @@ -9,7 +9,7 @@ import Foundation import FoundationNetworking #endif -protocol QueryStringEncodable { +protocol CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String } diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 9bd081f7d001..e15887fc3585 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct AdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct AdditionalPropertiesClass: Sendable, Codable, Hashable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index b20104e0503d..846d0bffd42e 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,7 @@ import Foundation -public struct Animal: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Animal: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index cea25ea52e2f..5f8cfe3d5102 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,7 @@ import Foundation -public struct ApiResponse: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ApiResponse: Sendable, Codable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 679279d61cb8..63dfb69bbabb 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index d71bd4e40b7f..3ed50f5074e1 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 839795229bb7..652ad17e7778 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayTest: Sendable, Codable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 56100523e841..a86eb5e7cc3f 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,7 @@ import Foundation -public struct Capitalization: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Capitalization: Sendable, Codable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index cceeddd1bf93..f4b05d09080b 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,7 @@ import Foundation -public struct Cat: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Cat: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index c04a9e673cf4..64f4cbd29125 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,7 @@ import Foundation -public struct Category: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Category: Sendable, Codable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 4c1e9c1a990b..559a00895906 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ClassModel: Sendable, Codable, Hashable { public var _class: String? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index b49ded4cc5c1..171b4da0eca7 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,7 @@ import Foundation -public struct Client: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Client: Sendable, Codable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 99231ca03f72..d48f9e70e605 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,7 @@ import Foundation -public struct Dog: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Dog: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 09bbcb9f2807..7bd97f59b82e 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,13 +7,13 @@ import Foundation -public struct EnumArrays: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumArrays: Sendable, Codable, Hashable { - public enum JustSymbol: String, Sendable, Codable, CaseIterable { + public enum JustSymbol: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" case dollar = "$" } - public enum ArrayEnum: String, Sendable, Codable, CaseIterable { + public enum ArrayEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case fish = "fish" case crab = "crab" } diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 56823c3a7aa1..b94c29a792cc 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,7 @@ import Foundation -public enum EnumClass: String, Sendable, Codable, CaseIterable { +public enum EnumClass: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" case xyz = "(xyz)" diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index d280112e88b3..9dd889d5fd6c 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,23 +7,23 @@ import Foundation -public struct EnumTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumTest: Sendable, Codable, Hashable { - public enum EnumString: String, Sendable, Codable, CaseIterable { + public enum EnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumStringRequired: String, Sendable, Codable, CaseIterable { + public enum EnumStringRequired: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumInteger: Int, Sendable, Codable, CaseIterable { + public enum EnumInteger: Int, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _1 = 1 case number1 = -1 } - public enum EnumNumber: Double, Sendable, Codable, CaseIterable { + public enum EnumNumber: Double, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _11 = 1.1 case number12 = -1.2 } diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index c35e1b2d53a4..7360adbc0a29 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Sendable, Codable, QueryStringEncodable, Hashable { +public struct File: Sendable, Codable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 6ca430a91ba7..54afadae66b5 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct FileSchemaTestClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FileSchemaTestClass: Sendable, Codable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 427b85e7fd9c..fe06e48fa23a 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct FormatTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FormatTest: Sendable, Codable, Hashable { public static let integerRule = NumericRule(minimum: 10, exclusiveMinimum: false, maximum: 100, exclusiveMaximum: false, multipleOf: nil) public static let int32Rule = NumericRule(minimum: 20, exclusiveMinimum: false, maximum: 200, exclusiveMaximum: false, multipleOf: nil) diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index e5db62551691..5b5fe48fb7e5 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct HasOnlyReadOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct HasOnlyReadOnly: Sendable, Codable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 75c553df8fc5..78e1feb2beff 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,7 @@ import Foundation -public struct List: Sendable, Codable, QueryStringEncodable, Hashable { +public struct List: Sendable, Codable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 8cc06717f317..210eef142f1e 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,9 +7,9 @@ import Foundation -public struct MapTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MapTest: Sendable, Codable, Hashable { - public enum MapOfEnumString: String, Sendable, Codable, CaseIterable { + public enum MapOfEnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 2c7bd6d9c7c2..06c6a2752677 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index dfe19e3fdd91..aeab3b15a102 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Model200Response: Sendable, Codable, Hashable { public var name: Int? public var _class: String? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index d0a98e0980bc..4f6830570025 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Name: Sendable, Codable, Hashable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 47d2e318bb5a..3621d67757e9 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct NumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct NumberOnly: Sendable, Codable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 6a9ecc5540c2..d4bc36f1f897 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,9 @@ import Foundation -public struct Order: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Order: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 0a4d002a2dda..5893a2807418 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,7 @@ import Foundation -public struct OuterComposite: Sendable, Codable, QueryStringEncodable, Hashable { +public struct OuterComposite: Sendable, Codable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9bcdaab8b218..3a5e3a720a24 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,7 @@ import Foundation -public enum OuterEnum: String, Sendable, Codable, CaseIterable { +public enum OuterEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 302a3052c6e5..97769ad6256b 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,9 @@ import Foundation -public struct Pet: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Pet: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case available = "available" case pending = "pending" case sold = "sold" diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 5a06da436f6a..fd389ad1422d 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,7 @@ import Foundation -public struct ReadOnlyFirst: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ReadOnlyFirst: Sendable, Codable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 53ca3f5ad7f8..2fd94d66e2ab 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Return: Sendable, Codable, Hashable { public var _return: Int? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 40ad8ff0a055..95c7afe37e25 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,7 @@ import Foundation -public struct SpecialModelName: Sendable, Codable, QueryStringEncodable, Hashable { +public struct SpecialModelName: Sendable, Codable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 3bbade9feb7b..50ecf3d40383 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,7 +7,7 @@ import Foundation -public struct StringBooleanMap: Sendable, Codable, QueryStringEncodable, Hashable { +public struct StringBooleanMap: Sendable, Codable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 7c19767a11fa..510c09ab0201 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,7 @@ import Foundation -public struct Tag: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Tag: Sendable, Codable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index eaaab7295001..0824151955c3 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderDefault: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderDefault: Sendable, Codable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index bac80c4fcd25..437e8d3a7a02 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderExample: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderExample: Sendable, Codable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index e41975d4d669..f012dafe19c6 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,7 @@ import Foundation -public struct User: Sendable, Codable, QueryStringEncodable, Hashable { +public struct User: Sendable, Codable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index c531bf4a1f77..54bcbedc355b 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -392,8 +392,7 @@ internal class FakeAPI { "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -524,8 +523,7 @@ internal class FakeAPI { "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ @@ -690,8 +688,7 @@ internal class FakeAPI { "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 524b1f4b5ace..2136615a4ec3 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -366,8 +366,7 @@ internal class PetAPI { "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -426,8 +425,7 @@ internal class PetAPI { "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -486,8 +484,7 @@ internal class PetAPI { "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift index f576985cdd7e..dc51330654c7 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift @@ -7,8 +7,8 @@ import Foundation internal struct APIHelper { - internal static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { - let destination = source.reduce(into: [String: any Sendable]()) { result, item in + internal static func rejectNil(_ source: [Key: Value?]) -> [Key: Value]? { + let destination = source.reduce(into: [Key: Value]()) { result, item in if let value = item.value { result[item.key] = value } @@ -20,7 +20,7 @@ internal struct APIHelper { return destination } - internal static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] { + internal static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { result, item in if let collection = item.value as? [Any?] { result[item.key] = collection @@ -32,21 +32,6 @@ internal struct APIHelper { } } - internal static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: any Sendable]()) { result, item in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - } - } - internal static func convertAnyToString(_ value: Any?) -> String? { guard let value = value else { return nil } if let value = value as? any RawRepresentable { diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift index 725aac0bcdb3..d0e275f8b904 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift @@ -9,57 +9,14 @@ import Foundation import FoundationNetworking #endif -extension QueryStringEncodable { - @_disfavoredOverload - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Bool: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Float: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int32: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int64: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Double: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Decimal: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension String: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension URL: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension UUID: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension RawRepresentable where RawValue: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) } +extension RawRepresentable where Self: CustomQueryStringEncodable { + func encodeToQueryString(codableHelper: CodableHelper) -> String { + encodeIfPossible(rawValue, codableHelper: codableHelper) + } } private func encodeIfPossible(_ object: T, codableHelper: CodableHelper) -> String { - if let encodableObject = object as? QueryStringEncodable { + if let encodableObject = object as? any CustomQueryStringEncodable { return encodableObject.encodeToQueryString(codableHelper: codableHelper) } else { return String(describing: object) @@ -88,27 +45,18 @@ extension Dictionary { } } -extension Data: QueryStringEncodable { +extension Data: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } -extension Date: QueryStringEncodable { +extension Date: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return codableHelper.dateFormatter.string(from: self) } } -extension QueryStringEncodable where Self: Encodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { - guard let data = try? codableHelper.jsonEncoder.encode(self) else { - fatalError("Could not encode to json: \(self)") - } - return data.encodeToQueryString(codableHelper: codableHelper) - } -} - extension String: @retroactive CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift index f763f8d092a5..07905e6c778b 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift @@ -9,7 +9,7 @@ import Foundation import FoundationNetworking #endif -protocol QueryStringEncodable { +protocol CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String } diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index cd94c1658ac5..c9dedfddee9a 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -internal struct AdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable { +internal struct AdditionalPropertiesClass: Sendable, Codable { internal private(set) var mapString: [String: String]? internal private(set) var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index f299bddbadc2..667d7f1ec772 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,7 @@ import Foundation -internal struct Animal: Sendable, Codable, QueryStringEncodable { +internal struct Animal: Sendable, Codable { internal private(set) var className: String internal private(set) var color: String? = "red" diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index eea24b505195..8f3170f74ac4 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,7 @@ import Foundation -internal struct ApiResponse: Sendable, Codable, QueryStringEncodable { +internal struct ApiResponse: Sendable, Codable { internal private(set) var code: Int? internal private(set) var type: String? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 2206e28fb943..aa098eb2c537 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -internal struct ArrayOfArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable { +internal struct ArrayOfArrayOfNumberOnly: Sendable, Codable { internal private(set) var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index 3f93ba4a0bb9..1dae1afc9282 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -internal struct ArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable { +internal struct ArrayOfNumberOnly: Sendable, Codable { internal private(set) var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index dbd72e91db21..921a8d716331 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,7 @@ import Foundation -internal struct ArrayTest: Sendable, Codable, QueryStringEncodable { +internal struct ArrayTest: Sendable, Codable { internal private(set) var arrayOfString: [String]? internal private(set) var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 981a46376762..0679eb0c69fc 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,7 @@ import Foundation -internal struct Capitalization: Sendable, Codable, QueryStringEncodable { +internal struct Capitalization: Sendable, Codable { internal private(set) var smallCamel: String? internal private(set) var capitalCamel: String? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index 2294c0d3e80c..01f3a520ecfe 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,7 @@ import Foundation -internal struct Cat: Sendable, Codable, QueryStringEncodable { +internal struct Cat: Sendable, Codable { internal private(set) var className: String internal private(set) var color: String? = "red" diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index f4c349f77cc2..518c5fad933d 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,7 @@ import Foundation -internal struct Category: Sendable, Codable, QueryStringEncodable, Hashable { +internal struct Category: Sendable, Codable, Hashable { internal private(set) var id: Int64? internal private(set) var name: String? = "default-name" diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index d45977632cef..afc40340ea5c 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -internal struct ClassModel: Sendable, Codable, QueryStringEncodable { +internal struct ClassModel: Sendable, Codable { internal private(set) var _class: String? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index ae658e54f3fb..9a4041815a67 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,7 @@ import Foundation -internal struct Client: Sendable, Codable, QueryStringEncodable { +internal struct Client: Sendable, Codable { internal private(set) var client: String? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 2c3e6c613914..17b21c5b14d4 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,7 @@ import Foundation -internal struct Dog: Sendable, Codable, QueryStringEncodable { +internal struct Dog: Sendable, Codable { internal private(set) var className: String internal private(set) var color: String? = "red" diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 1174d2f1a3c0..604a647e5252 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,14 +7,14 @@ import Foundation -internal struct EnumArrays: Sendable, Codable, QueryStringEncodable { +internal struct EnumArrays: Sendable, Codable { - internal enum JustSymbol: String, Sendable, Codable, CaseIterable, CaseIterableDefaultsLast { + internal enum JustSymbol: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable, CaseIterableDefaultsLast { case greaterThanOrEqualTo = ">=" case dollar = "$" case unknownDefaultOpenApi = "unknown_default_open_api" } - internal enum ArrayEnum: String, Sendable, Codable, CaseIterable, CaseIterableDefaultsLast { + internal enum ArrayEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable, CaseIterableDefaultsLast { case fish = "fish" case crab = "crab" case unknownDefaultOpenApi = "unknown_default_open_api" diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 3e38a7f73f9a..1d58133f981c 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,7 @@ import Foundation -internal enum EnumClass: String, Sendable, Codable, CaseIterable, CaseIterableDefaultsLast { +internal enum EnumClass: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable, CaseIterableDefaultsLast { case abc = "_abc" case efg = "-efg" case xyz = "(xyz)" diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index 3dfc4d8208a9..61fe882470c1 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,26 +7,26 @@ import Foundation -internal struct EnumTest: Sendable, Codable, QueryStringEncodable { +internal struct EnumTest: Sendable, Codable { - internal enum EnumString: String, Sendable, Codable, CaseIterable, CaseIterableDefaultsLast { + internal enum EnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable, CaseIterableDefaultsLast { case upper = "UPPER" case lower = "lower" case empty = "" case unknownDefaultOpenApi = "unknown_default_open_api" } - internal enum EnumStringRequired: String, Sendable, Codable, CaseIterable, CaseIterableDefaultsLast { + internal enum EnumStringRequired: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable, CaseIterableDefaultsLast { case upper = "UPPER" case lower = "lower" case empty = "" case unknownDefaultOpenApi = "unknown_default_open_api" } - internal enum EnumInteger: Int, Sendable, Codable, CaseIterable, CaseIterableDefaultsLast { + internal enum EnumInteger: Int, Sendable, CustomQueryStringEncodable, Codable, CaseIterable, CaseIterableDefaultsLast { case _1 = 1 case number1 = -1 case unknownDefaultOpenApi = 11184809 } - internal enum EnumNumber: Double, Sendable, Codable, CaseIterable, CaseIterableDefaultsLast { + internal enum EnumNumber: Double, Sendable, CustomQueryStringEncodable, Codable, CaseIterable, CaseIterableDefaultsLast { case _11 = 1.1 case number12 = -1.2 case unknownDefaultOpenApi = 11184809 diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index 4d49a28ba51f..20fcd8e79c89 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,7 @@ import Foundation /** Must be named `File` for test. */ -internal struct File: Sendable, Codable, QueryStringEncodable { +internal struct File: Sendable, Codable { /** Test capitalization */ internal private(set) var sourceURI: String? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index dde036f68068..1cf4b424574a 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,7 @@ import Foundation -internal struct FileSchemaTestClass: Sendable, Codable, QueryStringEncodable { +internal struct FileSchemaTestClass: Sendable, Codable { internal private(set) var file: File? internal private(set) var files: [File]? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index eeb7c62f70af..aa34c8eb6d08 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,7 @@ import Foundation -internal struct FormatTest: Sendable, Codable, QueryStringEncodable { +internal struct FormatTest: Sendable, Codable { internal static let integerRule = NumericRule(minimum: 10, exclusiveMinimum: false, maximum: 100, exclusiveMaximum: false, multipleOf: nil) internal static let int32Rule = NumericRule(minimum: 20, exclusiveMinimum: false, maximum: 200, exclusiveMaximum: false, multipleOf: nil) diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index 90dff39f23f2..983169c74a49 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,7 @@ import Foundation -internal struct HasOnlyReadOnly: Sendable, Codable, QueryStringEncodable { +internal struct HasOnlyReadOnly: Sendable, Codable { internal private(set) var bar: String? internal private(set) var foo: String? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 0f9fdf3b123c..c276123377dc 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,7 @@ import Foundation -internal struct List: Sendable, Codable, QueryStringEncodable { +internal struct List: Sendable, Codable { internal private(set) var _123list: String? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index db519aeb1d20..3576d3de9ed3 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,9 +7,9 @@ import Foundation -internal struct MapTest: Sendable, Codable, QueryStringEncodable { +internal struct MapTest: Sendable, Codable { - internal enum MapOfEnumString: String, Sendable, Codable, CaseIterable, CaseIterableDefaultsLast { + internal enum MapOfEnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable, CaseIterableDefaultsLast { case upper = "UPPER" case lower = "lower" case unknownDefaultOpenApi = "unknown_default_open_api" diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 34b7bce4cce7..6f152e9c5d8b 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -internal struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable { +internal struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable { internal private(set) var uuid: UUID? internal private(set) var dateTime: Date? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 91f96443c27a..8f6915565e95 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -internal struct Model200Response: Sendable, Codable, QueryStringEncodable { +internal struct Model200Response: Sendable, Codable { internal private(set) var name: Int? internal private(set) var _class: String? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index a21abc0e0712..af208c2696c3 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -internal struct Name: Sendable, Codable, QueryStringEncodable { +internal struct Name: Sendable, Codable { internal private(set) var name: Int internal private(set) var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index c229a50c78a0..34824d02341d 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -internal struct NumberOnly: Sendable, Codable, QueryStringEncodable { +internal struct NumberOnly: Sendable, Codable { internal private(set) var justNumber: Double? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 64841139f244..6f988f04895c 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,9 @@ import Foundation -internal struct Order: Sendable, Codable, QueryStringEncodable { +internal struct Order: Sendable, Codable { - internal enum Status: String, Sendable, Codable, CaseIterable, CaseIterableDefaultsLast { + internal enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable, CaseIterableDefaultsLast { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index e85a44fa9d46..5ab48176fad2 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,7 @@ import Foundation -internal struct OuterComposite: Sendable, Codable, QueryStringEncodable { +internal struct OuterComposite: Sendable, Codable { internal private(set) var myNumber: Double? internal private(set) var myString: String? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 37a718aed18d..43aaad7fb33c 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,7 @@ import Foundation -internal enum OuterEnum: String, Sendable, Codable, CaseIterable, CaseIterableDefaultsLast { +internal enum OuterEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable, CaseIterableDefaultsLast { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 91a8ef34143f..113bf11fc68c 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,9 @@ import Foundation -internal struct Pet: Sendable, Codable, QueryStringEncodable, Hashable { +internal struct Pet: Sendable, Codable, Hashable { - internal enum Status: String, Sendable, Codable, CaseIterable, CaseIterableDefaultsLast { + internal enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable, CaseIterableDefaultsLast { case available = "available" case pending = "pending" case sold = "sold" diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 77b1973aa427..c0bf5330b5c1 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,7 @@ import Foundation -internal struct ReadOnlyFirst: Sendable, Codable, QueryStringEncodable { +internal struct ReadOnlyFirst: Sendable, Codable { internal private(set) var bar: String? internal private(set) var baz: String? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index e2efcf5c4ecc..c42ef4a95e61 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing reserved words */ -internal struct Return: Sendable, Codable, QueryStringEncodable { +internal struct Return: Sendable, Codable { internal private(set) var _return: Int? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 3254476d0189..d81bbaa21fd3 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,7 @@ import Foundation -internal struct SpecialModelName: Sendable, Codable, QueryStringEncodable { +internal struct SpecialModelName: Sendable, Codable { internal private(set) var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 6e900ea29336..53fa34f2a451 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,7 +7,7 @@ import Foundation -internal struct StringBooleanMap: Sendable, Codable, QueryStringEncodable { +internal struct StringBooleanMap: Sendable, Codable { internal enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 1b2844889e13..08d6b28b9ef0 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,7 @@ import Foundation -internal struct Tag: Sendable, Codable, QueryStringEncodable, Hashable { +internal struct Tag: Sendable, Codable, Hashable { internal private(set) var id: Int64? internal private(set) var name: String? diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index 565dffc3983e..c5a36d9481a6 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,7 @@ import Foundation -internal struct TypeHolderDefault: Sendable, Codable, QueryStringEncodable { +internal struct TypeHolderDefault: Sendable, Codable { internal private(set) var stringItem: String = "what" internal private(set) var numberItem: Double diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index 95d17b53d075..9489434beb35 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,7 @@ import Foundation -internal struct TypeHolderExample: Sendable, Codable, QueryStringEncodable { +internal struct TypeHolderExample: Sendable, Codable { internal private(set) var stringItem: String internal private(set) var numberItem: Double diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index b5f6d6680fb6..3664e7153bb9 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,7 @@ import Foundation -internal struct User: Sendable, Codable, QueryStringEncodable { +internal struct User: Sendable, Codable { internal private(set) var id: Int64? internal private(set) var username: String? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 214c215e113b..a005ffc8a566 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -441,8 +441,7 @@ open class FakeAPI { "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -579,8 +578,7 @@ open class FakeAPI { "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ @@ -763,8 +761,7 @@ open class FakeAPI { "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index f020cbb840ab..baa880cc0fb8 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -409,8 +409,7 @@ open class PetAPI { "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -475,8 +474,7 @@ open class PetAPI { "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -541,8 +539,7 @@ open class PetAPI { "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift index b4218d3375c9..48606ea44cd1 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift @@ -7,8 +7,8 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { - let destination = source.reduce(into: [String: any Sendable]()) { result, item in + public static func rejectNil(_ source: [Key: Value?]) -> [Key: Value]? { + let destination = source.reduce(into: [Key: Value]()) { result, item in if let value = item.value { result[item.key] = value } @@ -20,7 +20,7 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { result, item in if let collection = item.value as? [Any?] { result[item.key] = collection @@ -32,21 +32,6 @@ public struct APIHelper { } } - public static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: any Sendable]()) { result, item in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - } - } - public static func convertAnyToString(_ value: Any?) -> String? { guard let value = value else { return nil } if let value = value as? any RawRepresentable { diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift index c88df32836d8..342042f03184 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift @@ -9,57 +9,14 @@ import Foundation import FoundationNetworking #endif -extension QueryStringEncodable { - @_disfavoredOverload - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Bool: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Float: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int32: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int64: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Double: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Decimal: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension String: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension URL: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension UUID: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension RawRepresentable where RawValue: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) } +extension RawRepresentable where Self: CustomQueryStringEncodable { + func encodeToQueryString(codableHelper: CodableHelper) -> String { + encodeIfPossible(rawValue, codableHelper: codableHelper) + } } private func encodeIfPossible(_ object: T, codableHelper: CodableHelper) -> String { - if let encodableObject = object as? QueryStringEncodable { + if let encodableObject = object as? any CustomQueryStringEncodable { return encodableObject.encodeToQueryString(codableHelper: codableHelper) } else { return String(describing: object) @@ -88,23 +45,14 @@ extension Dictionary { } } -extension Data: QueryStringEncodable { +extension Data: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } -extension Date: QueryStringEncodable { +extension Date: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return codableHelper.dateFormatter.string(from: self) } } - -extension QueryStringEncodable where Self: Encodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { - guard let data = try? codableHelper.jsonEncoder.encode(self) else { - fatalError("Could not encode to json: \(self)") - } - return data.encodeToQueryString(codableHelper: codableHelper) - } -} diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift index 78a06110af5e..59d2cdf20c67 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift @@ -9,7 +9,7 @@ import Foundation import FoundationNetworking #endif -protocol QueryStringEncodable { +protocol CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String } diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift index 9bd081f7d001..e15887fc3585 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct AdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct AdditionalPropertiesClass: Sendable, Codable, Hashable { public var mapString: [String: String]? public var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift index b20104e0503d..846d0bffd42e 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift @@ -7,7 +7,7 @@ import Foundation -public struct Animal: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Animal: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift index cea25ea52e2f..5f8cfe3d5102 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -7,7 +7,7 @@ import Foundation -public struct ApiResponse: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ApiResponse: Sendable, Codable, Hashable { public var code: Int? public var type: String? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift index 679279d61cb8..63dfb69bbabb 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift index d71bd4e40b7f..3ed50f5074e1 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayOfNumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayOfNumberOnly: Sendable, Codable, Hashable { public var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift index 839795229bb7..652ad17e7778 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct ArrayTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ArrayTest: Sendable, Codable, Hashable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift index 56100523e841..a86eb5e7cc3f 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift @@ -7,7 +7,7 @@ import Foundation -public struct Capitalization: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Capitalization: Sendable, Codable, Hashable { public var smallCamel: String? public var capitalCamel: String? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift index cceeddd1bf93..f4b05d09080b 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -7,7 +7,7 @@ import Foundation -public struct Cat: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Cat: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift index c04a9e673cf4..64f4cbd29125 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -7,7 +7,7 @@ import Foundation -public struct Category: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Category: Sendable, Codable, Hashable { public var id: Int64? public var name: String? = "default-name" diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift index 53147d21e440..a951d4971d30 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ClassModel: Sendable, Codable, Hashable { public var `class`: String? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift index b49ded4cc5c1..171b4da0eca7 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift @@ -7,7 +7,7 @@ import Foundation -public struct Client: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Client: Sendable, Codable, Hashable { public var client: String? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift index 99231ca03f72..d48f9e70e605 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift @@ -7,7 +7,7 @@ import Foundation -public struct Dog: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Dog: Sendable, Codable, Hashable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 09bbcb9f2807..7bd97f59b82e 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -7,13 +7,13 @@ import Foundation -public struct EnumArrays: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumArrays: Sendable, Codable, Hashable { - public enum JustSymbol: String, Sendable, Codable, CaseIterable { + public enum JustSymbol: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" case dollar = "$" } - public enum ArrayEnum: String, Sendable, Codable, CaseIterable { + public enum ArrayEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case fish = "fish" case crab = "crab" } diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index 56823c3a7aa1..b94c29a792cc 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,7 @@ import Foundation -public enum EnumClass: String, Sendable, Codable, CaseIterable { +public enum EnumClass: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" case xyz = "(xyz)" diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index d280112e88b3..9dd889d5fd6c 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -7,23 +7,23 @@ import Foundation -public struct EnumTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct EnumTest: Sendable, Codable, Hashable { - public enum EnumString: String, Sendable, Codable, CaseIterable { + public enum EnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumStringRequired: String, Sendable, Codable, CaseIterable { + public enum EnumStringRequired: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumInteger: Int, Sendable, Codable, CaseIterable { + public enum EnumInteger: Int, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _1 = 1 case number1 = -1 } - public enum EnumNumber: Double, Sendable, Codable, CaseIterable { + public enum EnumNumber: Double, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _11 = 1.1 case number12 = -1.2 } diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift index c35e1b2d53a4..7360adbc0a29 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift @@ -8,7 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Sendable, Codable, QueryStringEncodable, Hashable { +public struct File: Sendable, Codable, Hashable { /** Test capitalization */ public var sourceURI: String? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift index 6ca430a91ba7..54afadae66b5 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct FileSchemaTestClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FileSchemaTestClass: Sendable, Codable, Hashable { public var file: File? public var files: [File]? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift index 427b85e7fd9c..fe06e48fa23a 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -7,7 +7,7 @@ import Foundation -public struct FormatTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct FormatTest: Sendable, Codable, Hashable { public static let integerRule = NumericRule(minimum: 10, exclusiveMinimum: false, maximum: 100, exclusiveMaximum: false, multipleOf: nil) public static let int32Rule = NumericRule(minimum: 20, exclusiveMinimum: false, maximum: 200, exclusiveMaximum: false, multipleOf: nil) diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift index e5db62551691..5b5fe48fb7e5 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct HasOnlyReadOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct HasOnlyReadOnly: Sendable, Codable, Hashable { public var bar: String? public var foo: String? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift index 75c553df8fc5..78e1feb2beff 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift @@ -7,7 +7,7 @@ import Foundation -public struct List: Sendable, Codable, QueryStringEncodable, Hashable { +public struct List: Sendable, Codable, Hashable { public var _123list: String? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index 8cc06717f317..210eef142f1e 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -7,9 +7,9 @@ import Foundation -public struct MapTest: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MapTest: Sendable, Codable, Hashable { - public enum MapOfEnumString: String, Sendable, Codable, CaseIterable { + public enum MapOfEnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index 2c7bd6d9c7c2..06c6a2752677 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -7,7 +7,7 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, QueryStringEncodable, Hashable { +public struct MixedPropertiesAndAdditionalPropertiesClass: Sendable, Codable, Hashable { public var uuid: UUID? public var dateTime: Date? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift index 8c5d8c7381c3..8e272081f503 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Model200Response: Sendable, Codable, Hashable { public var name: Int? public var `class`: String? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index d0a98e0980bc..4f6830570025 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Name: Sendable, Codable, Hashable { public var name: Int public var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift index 47d2e318bb5a..3621d67757e9 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift @@ -7,7 +7,7 @@ import Foundation -public struct NumberOnly: Sendable, Codable, QueryStringEncodable, Hashable { +public struct NumberOnly: Sendable, Codable, Hashable { public var justNumber: Double? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 6a9ecc5540c2..d4bc36f1f897 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -7,9 +7,9 @@ import Foundation -public struct Order: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Order: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift index 0a4d002a2dda..5893a2807418 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift @@ -7,7 +7,7 @@ import Foundation -public struct OuterComposite: Sendable, Codable, QueryStringEncodable, Hashable { +public struct OuterComposite: Sendable, Codable, Hashable { public var myNumber: Double? public var myString: String? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9bcdaab8b218..3a5e3a720a24 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,7 @@ import Foundation -public enum OuterEnum: String, Sendable, Codable, CaseIterable { +public enum OuterEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 302a3052c6e5..97769ad6256b 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -7,9 +7,9 @@ import Foundation -public struct Pet: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Pet: Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case available = "available" case pending = "pending" case sold = "sold" diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift index 5a06da436f6a..fd389ad1422d 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift @@ -7,7 +7,7 @@ import Foundation -public struct ReadOnlyFirst: Sendable, Codable, QueryStringEncodable, Hashable { +public struct ReadOnlyFirst: Sendable, Codable, Hashable { public var bar: String? public var baz: String? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift index 119f1dd597f9..688465aee513 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift @@ -8,7 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Return: Sendable, Codable, Hashable { public var `return`: Int? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift index 40ad8ff0a055..95c7afe37e25 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift @@ -7,7 +7,7 @@ import Foundation -public struct SpecialModelName: Sendable, Codable, QueryStringEncodable, Hashable { +public struct SpecialModelName: Sendable, Codable, Hashable { public var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift index 8758ee8b93d5..87748ac59c09 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift @@ -7,7 +7,7 @@ import Foundation -public struct StringBooleanMap: Sendable, Codable, QueryStringEncodable, Hashable { +public struct StringBooleanMap: Sendable, Codable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift index 7c19767a11fa..510c09ab0201 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -7,7 +7,7 @@ import Foundation -public struct Tag: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Tag: Sendable, Codable, Hashable { public var id: Int64? public var name: String? diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift index eaaab7295001..0824151955c3 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderDefault: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderDefault: Sendable, Codable, Hashable { public var stringItem: String = "what" public var numberItem: Double diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift index bac80c4fcd25..437e8d3a7a02 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift @@ -7,7 +7,7 @@ import Foundation -public struct TypeHolderExample: Sendable, Codable, QueryStringEncodable, Hashable { +public struct TypeHolderExample: Sendable, Codable, Hashable { public var stringItem: String public var numberItem: Double diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift index e41975d4d669..f012dafe19c6 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -7,7 +7,7 @@ import Foundation -public struct User: Sendable, Codable, QueryStringEncodable, Hashable { +public struct User: Sendable, Codable, Hashable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index 0bbc0a13f9ac..2d5e37f104cc 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -395,8 +395,7 @@ open class FakeAPI { "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -527,8 +526,7 @@ open class FakeAPI { "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ @@ -693,8 +691,7 @@ open class FakeAPI { "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index 563bd708bf5b..814594e598c8 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -369,8 +369,7 @@ open class PetAPI { "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -429,8 +428,7 @@ open class PetAPI { "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -489,8 +487,7 @@ open class PetAPI { "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), ] - let localVariableNonNullParameters = APIHelper.rejectNil(localVariableFormParams) - let localVariableParameters = APIHelper.convertBoolToString(localVariableNonNullParameters) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift index b4218d3375c9..48606ea44cd1 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/APIHelper.swift @@ -7,8 +7,8 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { - let destination = source.reduce(into: [String: any Sendable]()) { result, item in + public static func rejectNil(_ source: [Key: Value?]) -> [Key: Value]? { + let destination = source.reduce(into: [Key: Value]()) { result, item in if let value = item.value { result[item.key] = value } @@ -20,7 +20,7 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { result, item in if let collection = item.value as? [Any?] { result[item.key] = collection @@ -32,21 +32,6 @@ public struct APIHelper { } } - public static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: any Sendable]()) { result, item in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - } - } - public static func convertAnyToString(_ value: Any?) -> String? { guard let value = value else { return nil } if let value = value as? any RawRepresentable { diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift index 1120f928d7ea..1cd0daecc9f0 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Extensions.swift @@ -9,57 +9,14 @@ import Foundation import FoundationNetworking #endif -extension QueryStringEncodable { - @_disfavoredOverload - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Bool: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Float: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int32: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int64: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Double: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Decimal: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension String: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension URL: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension UUID: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension RawRepresentable where RawValue: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) } +extension RawRepresentable where Self: CustomQueryStringEncodable { + func encodeToQueryString(codableHelper: CodableHelper) -> String { + encodeIfPossible(rawValue, codableHelper: codableHelper) + } } private func encodeIfPossible(_ object: T, codableHelper: CodableHelper) -> String { - if let encodableObject = object as? QueryStringEncodable { + if let encodableObject = object as? any CustomQueryStringEncodable { return encodableObject.encodeToQueryString(codableHelper: codableHelper) } else { return String(describing: object) @@ -88,27 +45,18 @@ extension Dictionary { } } -extension Data: QueryStringEncodable { +extension Data: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } -extension Date: QueryStringEncodable { +extension Date: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return codableHelper.dateFormatter.string(from: self) } } -extension QueryStringEncodable where Self: Encodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { - guard let data = try? codableHelper.jsonEncoder.encode(self) else { - fatalError("Could not encode to json: \(self)") - } - return data.encodeToQueryString(codableHelper: codableHelper) - } -} - extension String: @retroactive CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Models.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Models.swift index 78a06110af5e..59d2cdf20c67 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Infrastructure/Models.swift @@ -9,7 +9,7 @@ import Foundation import FoundationNetworking #endif -protocol QueryStringEncodable { +protocol CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String } diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift index ea478acb7d2c..bd875732936b 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/AdditionalPropertiesClass.swift @@ -12,7 +12,7 @@ public typealias AdditionalPropertiesClass = PetstoreClientAPI.AdditionalPropert extension PetstoreClientAPI { -public final class AdditionalPropertiesClass: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class AdditionalPropertiesClass: @unchecked Sendable, Codable, Hashable { public private(set) var mapString: [String: String]? public private(set) var mapMapString: [String: [String: String]]? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Animal.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Animal.swift index 357a845d2098..9c8d741839ea 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Animal.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Animal.swift @@ -12,7 +12,7 @@ public typealias Animal = PetstoreClientAPI.Animal extension PetstoreClientAPI { -public final class Animal: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class Animal: @unchecked Sendable, Codable, Hashable { public private(set) var className: String public private(set) var color: String? = "red" diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ApiResponse.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ApiResponse.swift index 4462e1f2a78c..d5402853b177 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ApiResponse.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ApiResponse.swift @@ -12,7 +12,7 @@ public typealias ApiResponse = PetstoreClientAPI.ApiResponse extension PetstoreClientAPI { -public final class ApiResponse: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class ApiResponse: @unchecked Sendable, Codable, Hashable { public private(set) var code: Int? public private(set) var type: String? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift index 60b1d85948b6..58cf0185e9ca 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfArrayOfNumberOnly.swift @@ -12,7 +12,7 @@ public typealias ArrayOfArrayOfNumberOnly = PetstoreClientAPI.ArrayOfArrayOfNumb extension PetstoreClientAPI { -public final class ArrayOfArrayOfNumberOnly: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class ArrayOfArrayOfNumberOnly: @unchecked Sendable, Codable, Hashable { public private(set) var arrayArrayNumber: [[Double]]? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift index 1274fde376ff..dc915b8b6bc5 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayOfNumberOnly.swift @@ -12,7 +12,7 @@ public typealias ArrayOfNumberOnly = PetstoreClientAPI.ArrayOfNumberOnly extension PetstoreClientAPI { -public final class ArrayOfNumberOnly: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class ArrayOfNumberOnly: @unchecked Sendable, Codable, Hashable { public private(set) var arrayNumber: [Double]? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayTest.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayTest.swift index ff04ef4605c7..5239007ffd9b 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayTest.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ArrayTest.swift @@ -12,7 +12,7 @@ public typealias ArrayTest = PetstoreClientAPI.ArrayTest extension PetstoreClientAPI { -public final class ArrayTest: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class ArrayTest: @unchecked Sendable, Codable, Hashable { public private(set) var arrayOfString: [String]? public private(set) var arrayArrayOfInteger: [[Int64]]? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Capitalization.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Capitalization.swift index 5dcd4d60b000..a6c8cdfbcc32 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Capitalization.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Capitalization.swift @@ -12,7 +12,7 @@ public typealias Capitalization = PetstoreClientAPI.Capitalization extension PetstoreClientAPI { -public final class Capitalization: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class Capitalization: @unchecked Sendable, Codable, Hashable { public private(set) var smallCamel: String? public private(set) var capitalCamel: String? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Cat.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Cat.swift index d45ec288b614..55a1b0763d2e 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Cat.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Cat.swift @@ -12,7 +12,7 @@ public typealias Cat = PetstoreClientAPI.Cat extension PetstoreClientAPI { -public final class Cat: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class Cat: @unchecked Sendable, Codable, Hashable { public private(set) var className: String public private(set) var color: String? = "red" diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift index e8e40daf46d0..6214d1c4ae60 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift @@ -12,7 +12,7 @@ public typealias Category = PetstoreClientAPI.Category extension PetstoreClientAPI { -public final class Category: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class Category: @unchecked Sendable, Codable, Hashable { public private(set) var id: Int64? public private(set) var name: String? = "default-name" diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ClassModel.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ClassModel.swift index 82ae62fe2c1c..a816aceec005 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ClassModel.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ClassModel.swift @@ -13,7 +13,7 @@ public typealias ClassModel = PetstoreClientAPI.ClassModel extension PetstoreClientAPI { /** Model for testing model with \"_class\" property */ -public final class ClassModel: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class ClassModel: @unchecked Sendable, Codable, Hashable { public private(set) var _class: String? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Client.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Client.swift index 4fa4270370aa..27f2a3704cad 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Client.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Client.swift @@ -12,7 +12,7 @@ public typealias Client = PetstoreClientAPI.Client extension PetstoreClientAPI { -public final class Client: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class Client: @unchecked Sendable, Codable, Hashable { public private(set) var client: String? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Dog.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Dog.swift index ae9f76466640..7b47b51db0ad 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Dog.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Dog.swift @@ -12,7 +12,7 @@ public typealias Dog = PetstoreClientAPI.Dog extension PetstoreClientAPI { -public final class Dog: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class Dog: @unchecked Sendable, Codable, Hashable { public private(set) var className: String public private(set) var color: String? = "red" diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/EnumArrays.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/EnumArrays.swift index ed9fe33b3818..e6a6287f90f2 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/EnumArrays.swift @@ -12,13 +12,13 @@ public typealias EnumArrays = PetstoreClientAPI.EnumArrays extension PetstoreClientAPI { -public final class EnumArrays: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class EnumArrays: @unchecked Sendable, Codable, Hashable { - public enum JustSymbol: String, Sendable, Codable, CaseIterable { + public enum JustSymbol: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" case dollar = "$" } - public enum ArrayEnum: String, Sendable, Codable, CaseIterable { + public enum ArrayEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case fish = "fish" case crab = "crab" } diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/EnumClass.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/EnumClass.swift index fa74d4c27fa8..13fc786c1fad 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/EnumClass.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/EnumClass.swift @@ -12,7 +12,7 @@ public typealias EnumClass = PetstoreClientAPI.EnumClass extension PetstoreClientAPI { -public enum EnumClass: String, Sendable, Codable, CaseIterable { +public enum EnumClass: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" case xyz = "(xyz)" diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/EnumTest.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/EnumTest.swift index 9eed072f206f..a734b1fd155d 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/EnumTest.swift @@ -12,23 +12,23 @@ public typealias EnumTest = PetstoreClientAPI.EnumTest extension PetstoreClientAPI { -public final class EnumTest: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class EnumTest: @unchecked Sendable, Codable, Hashable { - public enum EnumString: String, Sendable, Codable, CaseIterable { + public enum EnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumStringRequired: String, Sendable, Codable, CaseIterable { + public enum EnumStringRequired: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumInteger: Int, Sendable, Codable, CaseIterable { + public enum EnumInteger: Int, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _1 = 1 case number1 = -1 } - public enum EnumNumber: Double, Sendable, Codable, CaseIterable { + public enum EnumNumber: Double, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case _11 = 1.1 case number12 = -1.2 } diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/File.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/File.swift index b2988872347f..ca5c36944b93 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/File.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/File.swift @@ -13,7 +13,7 @@ public typealias File = PetstoreClientAPI.File extension PetstoreClientAPI { /** Must be named `File` for test. */ -public final class File: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class File: @unchecked Sendable, Codable, Hashable { /** Test capitalization */ public private(set) var sourceURI: String? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift index 92f30d1c7e7b..78db4e8d1522 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/FileSchemaTestClass.swift @@ -12,7 +12,7 @@ public typealias FileSchemaTestClass = PetstoreClientAPI.FileSchemaTestClass extension PetstoreClientAPI { -public final class FileSchemaTestClass: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class FileSchemaTestClass: @unchecked Sendable, Codable, Hashable { public private(set) var file: File? public private(set) var files: [File]? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/FormatTest.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/FormatTest.swift index 8e7646673a6f..5765691897d2 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/FormatTest.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/FormatTest.swift @@ -12,7 +12,7 @@ public typealias FormatTest = PetstoreClientAPI.FormatTest extension PetstoreClientAPI { -public final class FormatTest: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class FormatTest: @unchecked Sendable, Codable, Hashable { public static let integerRule = NumericRule(minimum: 10, exclusiveMinimum: false, maximum: 100, exclusiveMaximum: false, multipleOf: nil) public static let int32Rule = NumericRule(minimum: 20, exclusiveMinimum: false, maximum: 200, exclusiveMaximum: false, multipleOf: nil) diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift index 1837d18b4b8c..b60c0836b3f3 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/HasOnlyReadOnly.swift @@ -12,7 +12,7 @@ public typealias HasOnlyReadOnly = PetstoreClientAPI.HasOnlyReadOnly extension PetstoreClientAPI { -public final class HasOnlyReadOnly: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class HasOnlyReadOnly: @unchecked Sendable, Codable, Hashable { public private(set) var bar: String? public private(set) var foo: String? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/List.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/List.swift index a3c39e02da3a..41bc6a02c590 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/List.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/List.swift @@ -12,7 +12,7 @@ public typealias List = PetstoreClientAPI.List extension PetstoreClientAPI { -public final class List: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class List: @unchecked Sendable, Codable, Hashable { public private(set) var _123list: String? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/MapTest.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/MapTest.swift index 7f96dfa358e2..ce429b0289c2 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/MapTest.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/MapTest.swift @@ -12,9 +12,9 @@ public typealias MapTest = PetstoreClientAPI.MapTest extension PetstoreClientAPI { -public final class MapTest: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class MapTest: @unchecked Sendable, Codable, Hashable { - public enum MapOfEnumString: String, Sendable, Codable, CaseIterable { + public enum MapOfEnumString: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift index cc8d77a3afa5..de7ee77f258e 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/MixedPropertiesAndAdditionalPropertiesClass.swift @@ -12,7 +12,7 @@ public typealias MixedPropertiesAndAdditionalPropertiesClass = PetstoreClientAPI extension PetstoreClientAPI { -public final class MixedPropertiesAndAdditionalPropertiesClass: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class MixedPropertiesAndAdditionalPropertiesClass: @unchecked Sendable, Codable, Hashable { public private(set) var uuid: UUID? public private(set) var dateTime: Date? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Model200Response.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Model200Response.swift index bd6a2b39c639..62fb10c32c04 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Model200Response.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Model200Response.swift @@ -13,7 +13,7 @@ public typealias Model200Response = PetstoreClientAPI.Model200Response extension PetstoreClientAPI { /** Model for testing model name starting with number */ -public final class Model200Response: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class Model200Response: @unchecked Sendable, Codable, Hashable { public private(set) var name: Int? public private(set) var _class: String? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift index b8a7a669253a..023b723c113a 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift @@ -13,7 +13,7 @@ public typealias Name = PetstoreClientAPI.Name extension PetstoreClientAPI { /** Model for testing model name same as property name */ -public final class Name: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class Name: @unchecked Sendable, Codable, Hashable { public private(set) var name: Int public private(set) var snakeCase: NullEncodable = .encodeValue(11033) diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/NumberOnly.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/NumberOnly.swift index fa23845da2dc..f00fd2e3406f 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/NumberOnly.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/NumberOnly.swift @@ -12,7 +12,7 @@ public typealias NumberOnly = PetstoreClientAPI.NumberOnly extension PetstoreClientAPI { -public final class NumberOnly: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class NumberOnly: @unchecked Sendable, Codable, Hashable { public private(set) var justNumber: Double? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift index e9bbd2fb12b5..1d9edd2c0c7a 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift @@ -12,9 +12,9 @@ public typealias Order = PetstoreClientAPI.Order extension PetstoreClientAPI { -public final class Order: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class Order: @unchecked Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/OuterComposite.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/OuterComposite.swift index eec104a999d1..aded5bcdd882 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/OuterComposite.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/OuterComposite.swift @@ -12,7 +12,7 @@ public typealias OuterComposite = PetstoreClientAPI.OuterComposite extension PetstoreClientAPI { -public final class OuterComposite: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class OuterComposite: @unchecked Sendable, Codable, Hashable { public private(set) var myNumber: Double? public private(set) var myString: String? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/OuterEnum.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/OuterEnum.swift index 93a456e750ca..aaeafcfb9fd9 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/OuterEnum.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/OuterEnum.swift @@ -12,7 +12,7 @@ public typealias OuterEnum = PetstoreClientAPI.OuterEnum extension PetstoreClientAPI { -public enum OuterEnum: String, Sendable, Codable, CaseIterable { +public enum OuterEnum: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift index 6a9383bde10f..52024a369892 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift @@ -12,9 +12,9 @@ public typealias Pet = PetstoreClientAPI.Pet extension PetstoreClientAPI { -public final class Pet: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class Pet: @unchecked Sendable, Codable, Hashable { - public enum Status: String, Sendable, Codable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Codable, CaseIterable { case available = "available" case pending = "pending" case sold = "sold" diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift index 647ebd82e198..25a2f5169139 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/ReadOnlyFirst.swift @@ -12,7 +12,7 @@ public typealias ReadOnlyFirst = PetstoreClientAPI.ReadOnlyFirst extension PetstoreClientAPI { -public final class ReadOnlyFirst: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class ReadOnlyFirst: @unchecked Sendable, Codable, Hashable { public private(set) var bar: String? public private(set) var baz: String? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Return.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Return.swift index bf05589cea29..3af5424ab217 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Return.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Return.swift @@ -13,7 +13,7 @@ public typealias Return = PetstoreClientAPI.Return extension PetstoreClientAPI { /** Model for testing reserved words */ -public final class Return: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class Return: @unchecked Sendable, Codable, Hashable { public private(set) var _return: Int? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift index aaedf5eb82c8..ead92838f092 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/SpecialModelName.swift @@ -12,7 +12,7 @@ public typealias SpecialModelName = PetstoreClientAPI.SpecialModelName extension PetstoreClientAPI { -public final class SpecialModelName: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class SpecialModelName: @unchecked Sendable, Codable, Hashable { public private(set) var specialPropertyName: Int64? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift index 18bda640e085..7e828f247925 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/StringBooleanMap.swift @@ -12,7 +12,7 @@ public typealias StringBooleanMap = PetstoreClientAPI.StringBooleanMap extension PetstoreClientAPI { -public final class StringBooleanMap: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class StringBooleanMap: @unchecked Sendable, Codable, Hashable { public enum CodingKeys: CodingKey, CaseIterable { diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift index fe977d0e10fa..98727c593bf2 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift @@ -12,7 +12,7 @@ public typealias Tag = PetstoreClientAPI.Tag extension PetstoreClientAPI { -public final class Tag: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class Tag: @unchecked Sendable, Codable, Hashable { public private(set) var id: Int64? public private(set) var name: String? diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift index f8abdfee0882..8a01979a3b23 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderDefault.swift @@ -12,7 +12,7 @@ public typealias TypeHolderDefault = PetstoreClientAPI.TypeHolderDefault extension PetstoreClientAPI { -public final class TypeHolderDefault: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class TypeHolderDefault: @unchecked Sendable, Codable, Hashable { public private(set) var stringItem: String = "what" public private(set) var numberItem: Double diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift index 9020b77e43cb..d8a94518ba9c 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/TypeHolderExample.swift @@ -12,7 +12,7 @@ public typealias TypeHolderExample = PetstoreClientAPI.TypeHolderExample extension PetstoreClientAPI { -public final class TypeHolderExample: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class TypeHolderExample: @unchecked Sendable, Codable, Hashable { public private(set) var stringItem: String public private(set) var numberItem: Double diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift index 7a29f785a4c1..3447b1a8fe26 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift @@ -12,7 +12,7 @@ public typealias User = PetstoreClientAPI.User extension PetstoreClientAPI { -public final class User: @unchecked Sendable, Codable, QueryStringEncodable, Hashable { +public final class User: @unchecked Sendable, Codable, Hashable { public private(set) var id: Int64? public private(set) var username: String? diff --git a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift index b4218d3375c9..48606ea44cd1 100644 --- a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift +++ b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/APIHelper.swift @@ -7,8 +7,8 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: (any Sendable)?]) -> [String: any Sendable]? { - let destination = source.reduce(into: [String: any Sendable]()) { result, item in + public static func rejectNil(_ source: [Key: Value?]) -> [Key: Value]? { + let destination = source.reduce(into: [Key: Value]()) { result, item in if let value = item.value { result[item.key] = value } @@ -20,7 +20,7 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: (any Sendable)?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { return source.reduce(into: [String: String]()) { result, item in if let collection = item.value as? [Any?] { result[item.key] = collection @@ -32,21 +32,6 @@ public struct APIHelper { } } - public static func convertBoolToString(_ source: [String: any Sendable]?) -> [String: any Sendable]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: any Sendable]()) { result, item in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - } - } - public static func convertAnyToString(_ value: Any?) -> String? { guard let value = value else { return nil } if let value = value as? any RawRepresentable { diff --git a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift index 1120f928d7ea..1cd0daecc9f0 100644 --- a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift +++ b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Extensions.swift @@ -9,57 +9,14 @@ import Foundation import FoundationNetworking #endif -extension QueryStringEncodable { - @_disfavoredOverload - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Bool: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Float: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int32: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Int64: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Double: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension Decimal: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension String: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension URL: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension UUID: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: self) } -} - -extension RawRepresentable where RawValue: QueryStringEncodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { String(describing: rawValue) } +extension RawRepresentable where Self: CustomQueryStringEncodable { + func encodeToQueryString(codableHelper: CodableHelper) -> String { + encodeIfPossible(rawValue, codableHelper: codableHelper) + } } private func encodeIfPossible(_ object: T, codableHelper: CodableHelper) -> String { - if let encodableObject = object as? QueryStringEncodable { + if let encodableObject = object as? any CustomQueryStringEncodable { return encodableObject.encodeToQueryString(codableHelper: codableHelper) } else { return String(describing: object) @@ -88,27 +45,18 @@ extension Dictionary { } } -extension Data: QueryStringEncodable { +extension Data: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return self.base64EncodedString(options: Data.Base64EncodingOptions()) } } -extension Date: QueryStringEncodable { +extension Date: CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String { return codableHelper.dateFormatter.string(from: self) } } -extension QueryStringEncodable where Self: Encodable { - func encodeToQueryString(codableHelper: CodableHelper) -> String { - guard let data = try? codableHelper.jsonEncoder.encode(self) else { - fatalError("Could not encode to json: \(self)") - } - return data.encodeToQueryString(codableHelper: codableHelper) - } -} - extension String: @retroactive CodingKey { public var stringValue: String { diff --git a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift index 78a06110af5e..59d2cdf20c67 100644 --- a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift +++ b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Infrastructure/Models.swift @@ -9,7 +9,7 @@ import Foundation import FoundationNetworking #endif -protocol QueryStringEncodable { +protocol CustomQueryStringEncodable { func encodeToQueryString(codableHelper: CodableHelper) -> String } diff --git a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift index 81ddce1c41eb..b693c50fb9e5 100644 --- a/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift +++ b/samples/client/petstore/swift6/validation/PetstoreClient/Classes/OpenAPIs/Models/Banana.swift @@ -7,7 +7,7 @@ import Foundation -public struct Banana: Sendable, Codable, QueryStringEncodable, Hashable { +public struct Banana: Sendable, Codable, Hashable { public static let countRule = NumericRule(minimum: 10, exclusiveMinimum: true, maximum: 100, exclusiveMaximum: true, multipleOf: 5) public static let idsRule = ArrayRule(minItems: 1, maxItems: 10, uniqueItems: false) diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift index 38b07f79246b..7be49b2ad7f9 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/BigCat.swift @@ -10,7 +10,7 @@ import Vapor public final class BigCat: Content, Hashable { - public enum Kind: String, Sendable, Content, Hashable, CaseIterable { + public enum Kind: String, Sendable, CustomQueryStringEncodable, Content, Hashable, CaseIterable { case lions = "lions" case tigers = "tigers" case leopards = "leopards" diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift index a563c354db7d..9f1ec6bbf372 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumArrays.swift @@ -10,11 +10,11 @@ import Vapor public final class EnumArrays: Content, Hashable { - public enum JustSymbol: String, Sendable, Content, Hashable, CaseIterable { + public enum JustSymbol: String, Sendable, CustomQueryStringEncodable, Content, Hashable, CaseIterable { case greaterThanOrEqualTo = ">=" case dollar = "$" } - public enum ArrayEnum: String, Sendable, Content, Hashable, CaseIterable { + public enum ArrayEnum: String, Sendable, CustomQueryStringEncodable, Content, Hashable, CaseIterable { case fish = "fish" case crab = "crab" } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumClass.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumClass.swift index 13a687767d18..badca1276ca1 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumClass.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumClass.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public enum EnumClass: String, Sendable, Content, Hashable, CaseIterable { +public enum EnumClass: String, Sendable, CustomQueryStringEncodable, Content, Hashable, CaseIterable { case abc = "_abc" case efg = "-efg" case xyz = "(xyz)" diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift index 15779b57b9f9..768359065dbe 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/EnumTest.swift @@ -10,21 +10,21 @@ import Vapor public final class EnumTest: Content, Hashable { - public enum EnumString: String, Sendable, Content, Hashable, CaseIterable { + public enum EnumString: String, Sendable, CustomQueryStringEncodable, Content, Hashable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumStringRequired: String, Sendable, Content, Hashable, CaseIterable { + public enum EnumStringRequired: String, Sendable, CustomQueryStringEncodable, Content, Hashable, CaseIterable { case upper = "UPPER" case lower = "lower" case empty = "" } - public enum EnumInteger: Int, Sendable, Content, Hashable, CaseIterable { + public enum EnumInteger: Int, Sendable, CustomQueryStringEncodable, Content, Hashable, CaseIterable { case _1 = 1 case number1 = -1 } - public enum EnumNumber: Double, Sendable, Content, Hashable, CaseIterable { + public enum EnumNumber: Double, Sendable, CustomQueryStringEncodable, Content, Hashable, CaseIterable { case _11 = 1.1 case number12 = -1.2 } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift index d74262b414d8..9680499b8ef4 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/MapTest.swift @@ -10,7 +10,7 @@ import Vapor public final class MapTest: Content, Hashable { - public enum MapOfEnumString: String, Sendable, Content, Hashable, CaseIterable { + public enum MapOfEnumString: String, Sendable, CustomQueryStringEncodable, Content, Hashable, CaseIterable { case upper = "UPPER" case lower = "lower" } diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift index c6ebc2461026..26713dda07e0 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Order.swift @@ -10,7 +10,7 @@ import Vapor public final class Order: Content, Hashable { - public enum Status: String, Sendable, Content, Hashable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Content, Hashable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterEnum.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterEnum.swift index e30507f7ce8b..322771ab84f9 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterEnum.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/OuterEnum.swift @@ -8,7 +8,7 @@ import Foundation import Vapor -public enum OuterEnum: String, Sendable, Content, Hashable, CaseIterable { +public enum OuterEnum: String, Sendable, CustomQueryStringEncodable, Content, Hashable, CaseIterable { case placed = "placed" case approved = "approved" case delivered = "delivered" diff --git a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift index 04cffcaa7fc0..0e0fc5511a19 100644 --- a/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift +++ b/samples/client/petstore/swift6/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift @@ -10,7 +10,7 @@ import Vapor public final class Pet: Content, Hashable { - public enum Status: String, Sendable, Content, Hashable, CaseIterable { + public enum Status: String, Sendable, CustomQueryStringEncodable, Content, Hashable, CaseIterable { case available = "available" case pending = "pending" case sold = "sold" From 7fc0c4df01ec7ac6a84e5dc2b7f920af601596f3 Mon Sep 17 00:00:00 2001 From: Lennard Sprong Date: Thu, 24 Apr 2025 13:08:02 +0000 Subject: [PATCH 2/2] Add call to encodeToQueryString only once per request --- .../src/main/resources/swift6/_param.mustache | 2 +- .../src/main/resources/swift6/api.mustache | 2 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 68 ++++++++-------- .../Sources/PetstoreClient/APIs/PetAPI.swift | 24 +++--- .../Sources/PetstoreClient/APIs/UserAPI.swift | 4 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 68 ++++++++-------- .../Sources/PetstoreClient/APIs/PetAPI.swift | 24 +++--- .../Sources/PetstoreClient/APIs/UserAPI.swift | 4 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 68 ++++++++-------- .../Sources/PetstoreClient/APIs/PetAPI.swift | 24 +++--- .../Sources/PetstoreClient/APIs/UserAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 68 ++++++++-------- .../Classes/OpenAPIs/APIs/PetAPI.swift | 24 +++--- .../Classes/OpenAPIs/APIs/UserAPI.swift | 4 +- .../Sources/CombineLibrary/APIs/FakeAPI.swift | 68 ++++++++-------- .../Sources/CombineLibrary/APIs/PetAPI.swift | 24 +++--- .../Sources/CombineLibrary/APIs/UserAPI.swift | 4 +- .../PetstoreClient/APIs/AnotherFakeAPI.swift | 2 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 78 +++++++++---------- .../Sources/PetstoreClient/APIs/PetAPI.swift | 24 +++--- .../Sources/PetstoreClient/APIs/UserAPI.swift | 4 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 68 ++++++++-------- .../Sources/PetstoreClient/APIs/PetAPI.swift | 24 +++--- .../Sources/PetstoreClient/APIs/UserAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 68 ++++++++-------- .../Classes/OpenAPIs/APIs/PetAPI.swift | 24 +++--- .../Classes/OpenAPIs/APIs/UserAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 68 ++++++++-------- .../Classes/OpenAPIs/APIs/PetAPI.swift | 24 +++--- .../Classes/OpenAPIs/APIs/UserAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 68 ++++++++-------- .../Classes/OpenAPIs/APIs/PetAPI.swift | 24 +++--- .../Classes/OpenAPIs/APIs/UserAPI.swift | 4 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 68 ++++++++-------- .../Sources/PetstoreClient/APIs/PetAPI.swift | 24 +++--- .../Sources/PetstoreClient/APIs/UserAPI.swift | 4 +- 36 files changed, 536 insertions(+), 536 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift6/_param.mustache b/modules/openapi-generator/src/main/resources/swift6/_param.mustache index bdadb82c623e..59939a56b110 100644 --- a/modules/openapi-generator/src/main/resources/swift6/_param.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/_param.mustache @@ -1 +1 @@ -"{{baseName}}": {{#isQueryParam}}(wrappedValue: {{/isQueryParam}}{{paramName}}{{^required}}?{{/required}}.encodeToQueryString(codableHelper: apiConfiguration.codableHelper){{#isQueryParam}}, isExplode: {{isExplode}}){{/isQueryParam}} \ No newline at end of file +"{{baseName}}": {{#isQueryParam}}(wrappedValue: {{/isQueryParam}}{{paramName}}{{#isQueryParam}}, isExplode: {{isExplode}}){{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/swift6/api.mustache b/modules/openapi-generator/src/main/resources/swift6/api.mustache index a7f07464d17e..e2d504d2e916 100644 --- a/modules/openapi-generator/src/main/resources/swift6/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift6/api.mustache @@ -301,7 +301,7 @@ extension {{projectName}}API { {{/formParams}} ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) {{/hasFormParams}} {{^hasFormParams}} let localVariableParameters: [String: any Sendable]? = nil diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index 6ecb12a0dede..d6356226fc92 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -257,7 +257,7 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": (wrappedValue: query.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "query": (wrappedValue: query, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -376,23 +376,23 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "integer": integer?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int32": int32?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int64": int64?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "number": number.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "float": float?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "double": double.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "string": string?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "byte": byte.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "binary": binary?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "date": date?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "dateTime": dateTime?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "password": password?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "integer": integer, + "int32": int32, + "int64": int64, + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date, + "dateTime": dateTime, + "password": password, + "callback": callback, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -519,24 +519,24 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": (wrappedValue: enumQueryStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_string": (wrappedValue: enumQueryString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_integer": (wrappedValue: enumQueryInteger?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_double": (wrappedValue: enumQueryDouble?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "enum_query_string_array": (wrappedValue: enumQueryStringArray, isExplode: false), + "enum_query_string": (wrappedValue: enumQueryString, isExplode: false), + "enum_query_integer": (wrappedValue: enumQueryInteger, isExplode: false), + "enum_query_double": (wrappedValue: enumQueryDouble, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ "Content-Type": "application/x-www-form-urlencoded", - "enum_header_string_array": enumHeaderStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_header_string": enumHeaderString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -590,15 +590,15 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": (wrappedValue: requiredStringGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "required_int64_group": (wrappedValue: requiredInt64Group.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "string_group": (wrappedValue: stringGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "int64_group": (wrappedValue: int64Group?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "required_string_group": (wrappedValue: requiredStringGroup, isExplode: false), + "required_int64_group": (wrappedValue: requiredInt64Group, isExplode: false), + "string_group": (wrappedValue: stringGroup, isExplode: false), + "int64_group": (wrappedValue: int64Group, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "boolean_group": booleanGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -684,11 +684,11 @@ open class FakeAPI { let localVariablePath = "/fake/jsonFormData" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "param": param.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "param": param, + "param2": param2, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index 61180a5aeffd..753ede0e7944 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -101,7 +101,7 @@ open class PetAPI { let localVariableUrlComponents = URLComponents(string: localVariableURLString) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "api_key": apiKey?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "api_key": apiKey, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -157,7 +157,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": (wrappedValue: status.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "status": (wrappedValue: status, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -210,7 +210,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": (wrappedValue: tags.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "tags": (wrappedValue: tags, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -362,11 +362,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "name": name?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "name": name, + "status": status, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -421,11 +421,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "file": file, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -480,11 +480,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/UserAPI.swift index d9e47ad7fb4e..e037bc277696 100644 --- a/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/APIs/UserAPI.swift @@ -273,8 +273,8 @@ open class UserAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": (wrappedValue: username.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "password": (wrappedValue: password.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "username": (wrappedValue: username, isExplode: false), + "password": (wrappedValue: password, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift index 3313b41899d0..812753997768 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -847,7 +847,7 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": (wrappedValue: query.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "query": (wrappedValue: query, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -1233,23 +1233,23 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "integer": integer?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int32": int32?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int64": int64?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "number": number.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "float": float?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "double": double.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "string": string?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "byte": byte.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "binary": binary?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "date": date?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "dateTime": dateTime?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "password": password?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "integer": integer, + "int32": int32, + "int64": int64, + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date, + "dateTime": dateTime, + "password": password, + "callback": callback, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -1512,24 +1512,24 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": (wrappedValue: enumQueryStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_string": (wrappedValue: enumQueryString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_integer": (wrappedValue: enumQueryInteger?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_double": (wrappedValue: enumQueryDouble?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "enum_query_string_array": (wrappedValue: enumQueryStringArray, isExplode: false), + "enum_query_string": (wrappedValue: enumQueryString, isExplode: false), + "enum_query_integer": (wrappedValue: enumQueryInteger, isExplode: false), + "enum_query_double": (wrappedValue: enumQueryDouble, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ "Content-Type": "application/x-www-form-urlencoded", - "enum_header_string_array": enumHeaderStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_header_string": enumHeaderString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -1709,15 +1709,15 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": (wrappedValue: requiredStringGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "required_int64_group": (wrappedValue: requiredInt64Group.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "string_group": (wrappedValue: stringGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "int64_group": (wrappedValue: int64Group?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "required_string_group": (wrappedValue: requiredStringGroup, isExplode: false), + "required_int64_group": (wrappedValue: requiredInt64Group, isExplode: false), + "string_group": (wrappedValue: stringGroup, isExplode: false), + "int64_group": (wrappedValue: int64Group, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "boolean_group": booleanGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -2010,11 +2010,11 @@ open class FakeAPI { let localVariablePath = "/fake/jsonFormData" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "param": param.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "param": param, + "param2": param2, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift index 4132d046355a..b77dda9a1c09 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/PetAPI.swift @@ -317,7 +317,7 @@ open class PetAPI { let localVariableUrlComponents = URLComponents(string: localVariableURLString) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "api_key": apiKey?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "api_key": apiKey, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -474,7 +474,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": (wrappedValue: status.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "status": (wrappedValue: status, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -633,7 +633,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": (wrappedValue: tags.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "tags": (wrappedValue: tags, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -1098,11 +1098,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "name": name?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "name": name, + "status": status, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -1268,11 +1268,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "file": file, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -1438,11 +1438,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/UserAPI.swift index ab4c065bcfb0..2623e1dfa2ca 100644 --- a/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/APIs/UserAPI.swift @@ -893,8 +893,8 @@ open class UserAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": (wrappedValue: username.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "password": (wrappedValue: password.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "username": (wrappedValue: username, isExplode: false), + "password": (wrappedValue: password, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index 1a30b08fdb2f..35cedb608c65 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -215,7 +215,7 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": (wrappedValue: query.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "query": (wrappedValue: query, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -320,23 +320,23 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "integer": integer?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int32": int32?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int64": int64?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "number": number.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "float": float?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "double": double.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "string": string?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "byte": byte.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "binary": binary?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "date": date?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "dateTime": dateTime?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "password": password?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "integer": integer, + "int32": int32, + "int64": int64, + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date, + "dateTime": dateTime, + "password": password, + "callback": callback, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -456,24 +456,24 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": (wrappedValue: enumQueryStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_string": (wrappedValue: enumQueryString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_integer": (wrappedValue: enumQueryInteger?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_double": (wrappedValue: enumQueryDouble?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "enum_query_string_array": (wrappedValue: enumQueryStringArray, isExplode: false), + "enum_query_string": (wrappedValue: enumQueryString, isExplode: false), + "enum_query_integer": (wrappedValue: enumQueryInteger, isExplode: false), + "enum_query_double": (wrappedValue: enumQueryDouble, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ "Content-Type": "application/x-www-form-urlencoded", - "enum_header_string_array": enumHeaderStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_header_string": enumHeaderString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -520,15 +520,15 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": (wrappedValue: requiredStringGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "required_int64_group": (wrappedValue: requiredInt64Group.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "string_group": (wrappedValue: stringGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "int64_group": (wrappedValue: int64Group?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "required_string_group": (wrappedValue: requiredStringGroup, isExplode: false), + "required_int64_group": (wrappedValue: requiredInt64Group, isExplode: false), + "string_group": (wrappedValue: stringGroup, isExplode: false), + "int64_group": (wrappedValue: int64Group, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "boolean_group": booleanGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -600,11 +600,11 @@ open class FakeAPI { let localVariablePath = "/fake/jsonFormData" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "param": param.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "param": param, + "param2": param2, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index 72483c6529b2..11beb416b735 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -87,7 +87,7 @@ open class PetAPI { let localVariableUrlComponents = URLComponents(string: localVariableURLString) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "api_key": apiKey?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "api_key": apiKey, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -136,7 +136,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": (wrappedValue: status.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "status": (wrappedValue: status, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -182,7 +182,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": (wrappedValue: tags.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "tags": (wrappedValue: tags, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -313,11 +313,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "name": name?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "name": name, + "status": status, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -365,11 +365,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "file": file, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -417,11 +417,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/UserAPI.swift index 83974395c2cb..dcd2516606f6 100644 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/APIs/UserAPI.swift @@ -231,8 +231,8 @@ open class UserAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": (wrappedValue: username.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "password": (wrappedValue: password.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "username": (wrappedValue: username, isExplode: false), + "password": (wrappedValue: password, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 20e3f2c5f9f9..5b2658a1ce4e 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -338,7 +338,7 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": (wrappedValue: query.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "query": (wrappedValue: query, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -483,23 +483,23 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "integer": integer?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int32": int32?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int64": int64?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "number": number.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "float": float?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "double": double.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "string": string?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "byte": byte.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "binary": binary?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "date": date?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "dateTime": dateTime?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "password": password?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "integer": integer, + "int32": int32, + "int64": int64, + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date, + "dateTime": dateTime, + "password": password, + "callback": callback, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -639,24 +639,24 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": (wrappedValue: enumQueryStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_string": (wrappedValue: enumQueryString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_integer": (wrappedValue: enumQueryInteger?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_double": (wrappedValue: enumQueryDouble?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "enum_query_string_array": (wrappedValue: enumQueryStringArray, isExplode: false), + "enum_query_string": (wrappedValue: enumQueryString, isExplode: false), + "enum_query_integer": (wrappedValue: enumQueryInteger, isExplode: false), + "enum_query_double": (wrappedValue: enumQueryDouble, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ "Content-Type": "application/x-www-form-urlencoded", - "enum_header_string_array": enumHeaderStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_header_string": enumHeaderString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -723,15 +723,15 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": (wrappedValue: requiredStringGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "required_int64_group": (wrappedValue: requiredInt64Group.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "string_group": (wrappedValue: stringGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "int64_group": (wrappedValue: int64Group?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "required_string_group": (wrappedValue: requiredStringGroup, isExplode: false), + "required_int64_group": (wrappedValue: requiredInt64Group, isExplode: false), + "string_group": (wrappedValue: stringGroup, isExplode: false), + "int64_group": (wrappedValue: int64Group, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "boolean_group": booleanGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -843,11 +843,11 @@ open class FakeAPI { let localVariablePath = "/fake/jsonFormData" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "param": param.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "param": param, + "param2": param2, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 22fc33ee53be..52e99e5222ec 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -130,7 +130,7 @@ open class PetAPI { let localVariableUrlComponents = URLComponents(string: localVariableURLString) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "api_key": apiKey?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "api_key": apiKey, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -199,7 +199,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": (wrappedValue: status.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "status": (wrappedValue: status, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -265,7 +265,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": (wrappedValue: tags.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "tags": (wrappedValue: tags, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -456,11 +456,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "name": name?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "name": name, + "status": status, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -528,11 +528,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "file": file, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -600,11 +600,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 79b157a98421..c404e27b92fd 100644 --- a/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -354,8 +354,8 @@ open class UserAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": (wrappedValue: username.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "password": (wrappedValue: password.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "username": (wrappedValue: username, isExplode: false), + "password": (wrappedValue: password, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/FakeAPI.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/FakeAPI.swift index 65e1360223c8..a617df336943 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/FakeAPI.swift @@ -326,7 +326,7 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": (wrappedValue: query.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "query": (wrappedValue: query, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -467,23 +467,23 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "integer": integer?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int32": int32?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int64": int64?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "number": number.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "float": float?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "double": double.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "string": string?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "byte": byte.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "binary": binary?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "date": date?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "dateTime": dateTime?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "password": password?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "integer": integer, + "int32": int32, + "int64": int64, + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date, + "dateTime": dateTime, + "password": password, + "callback": callback, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -621,24 +621,24 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": (wrappedValue: enumQueryStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_string": (wrappedValue: enumQueryString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_integer": (wrappedValue: enumQueryInteger?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_double": (wrappedValue: enumQueryDouble?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "enum_query_string_array": (wrappedValue: enumQueryStringArray, isExplode: false), + "enum_query_string": (wrappedValue: enumQueryString, isExplode: false), + "enum_query_integer": (wrappedValue: enumQueryInteger, isExplode: false), + "enum_query_double": (wrappedValue: enumQueryDouble, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ "Content-Type": "application/x-www-form-urlencoded", - "enum_header_string_array": enumHeaderStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_header_string": enumHeaderString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -703,15 +703,15 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": (wrappedValue: requiredStringGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "required_int64_group": (wrappedValue: requiredInt64Group.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "string_group": (wrappedValue: stringGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "int64_group": (wrappedValue: int64Group?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "required_string_group": (wrappedValue: requiredStringGroup, isExplode: false), + "required_int64_group": (wrappedValue: requiredInt64Group, isExplode: false), + "string_group": (wrappedValue: stringGroup, isExplode: false), + "int64_group": (wrappedValue: int64Group, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "boolean_group": booleanGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -819,11 +819,11 @@ open class FakeAPI { let localVariablePath = "/fake/jsonFormData" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "param": param.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "param": param, + "param2": param2, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/PetAPI.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/PetAPI.swift index 1d012d732f13..9a9dc0d9b475 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/PetAPI.swift @@ -126,7 +126,7 @@ open class PetAPI { let localVariableUrlComponents = URLComponents(string: localVariableURLString) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "api_key": apiKey?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "api_key": apiKey, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -193,7 +193,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": (wrappedValue: status.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "status": (wrappedValue: status, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -257,7 +257,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": (wrappedValue: tags.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "tags": (wrappedValue: tags, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -442,11 +442,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "name": name?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "name": name, + "status": status, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -512,11 +512,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "file": file, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -582,11 +582,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/UserAPI.swift b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/UserAPI.swift index f8f373e93a92..b2ca37946a4f 100644 --- a/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/APIs/UserAPI.swift @@ -342,8 +342,8 @@ open class UserAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": (wrappedValue: username.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "password": (wrappedValue: password.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "username": (wrappedValue: username, isExplode: false), + "password": (wrappedValue: password, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift index 5c1e5f69bf5d..42d9fe2d89c7 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift @@ -40,7 +40,7 @@ open class AnotherFakeAPI { let localVariableNillableHeaders: [String: (any Sendable)?] = [ "Content-Type": "application/json", - "uuid_test": uuidTest.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "uuid_test": uuidTest, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift index 2da258a434b7..c33609423c0a 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -253,7 +253,7 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": (wrappedValue: query.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "query": (wrappedValue: query, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -358,23 +358,23 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "integer": integer?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int32": int32?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int64": int64?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "number": number.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "float": float?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "double": double.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "string": string?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "byte": byte.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "binary": binary?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "date": date?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "dateTime": dateTime?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "password": password?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "integer": integer, + "int32": int32, + "int64": int64, + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date, + "dateTime": dateTime, + "password": password, + "callback": callback, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -494,24 +494,24 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": (wrappedValue: enumQueryStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_string": (wrappedValue: enumQueryString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_integer": (wrappedValue: enumQueryInteger?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_double": (wrappedValue: enumQueryDouble?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "enum_query_string_array": (wrappedValue: enumQueryStringArray, isExplode: false), + "enum_query_string": (wrappedValue: enumQueryString, isExplode: false), + "enum_query_integer": (wrappedValue: enumQueryInteger, isExplode: false), + "enum_query_double": (wrappedValue: enumQueryDouble, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ "Content-Type": "application/x-www-form-urlencoded", - "enum_header_string_array": enumHeaderStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_header_string": enumHeaderString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -558,15 +558,15 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": (wrappedValue: requiredStringGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "required_int64_group": (wrappedValue: requiredInt64Group.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "string_group": (wrappedValue: stringGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "int64_group": (wrappedValue: int64Group?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "required_string_group": (wrappedValue: requiredStringGroup, isExplode: false), + "required_int64_group": (wrappedValue: requiredInt64Group, isExplode: false), + "string_group": (wrappedValue: stringGroup, isExplode: false), + "int64_group": (wrappedValue: int64Group, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "boolean_group": booleanGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -638,11 +638,11 @@ open class FakeAPI { let localVariablePath = "/fake/jsonFormData" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "param": param.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "param": param, + "param2": param2, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -690,11 +690,11 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "pipe": (wrappedValue: pipe.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "ioutil": (wrappedValue: ioutil.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "http": (wrappedValue: http.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "url": (wrappedValue: url.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "context": (wrappedValue: context.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: true), + "pipe": (wrappedValue: pipe, isExplode: false), + "ioutil": (wrappedValue: ioutil, isExplode: false), + "http": (wrappedValue: http, isExplode: false), + "url": (wrappedValue: url, isExplode: false), + "context": (wrappedValue: context, isExplode: true), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift index aeb57c47afe3..96f88bdf4d69 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/PetAPI.swift @@ -84,7 +84,7 @@ open class PetAPI { let localVariableUrlComponents = URLComponents(string: localVariableURLString) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "api_key": apiKey?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "api_key": apiKey, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -133,7 +133,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": (wrappedValue: status.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "status": (wrappedValue: status, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -179,7 +179,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": (wrappedValue: tags.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "tags": (wrappedValue: tags, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -310,11 +310,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "name": name?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "name": name, + "status": status, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -362,11 +362,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "file": file, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -414,11 +414,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/UserAPI.swift index 83974395c2cb..dcd2516606f6 100644 --- a/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/default/Sources/PetstoreClient/APIs/UserAPI.swift @@ -231,8 +231,8 @@ open class UserAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": (wrappedValue: username.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "password": (wrappedValue: password.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "username": (wrappedValue: username, isExplode: false), + "password": (wrappedValue: password, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/FakeAPI.swift index 5f792648b259..7eae1e3e75cb 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -257,7 +257,7 @@ import Foundation var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": (wrappedValue: query.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "query": (wrappedValue: query, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -376,23 +376,23 @@ import Foundation let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "integer": integer?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int32": int32?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int64": int64?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "number": number.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "float": float?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "double": double.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "string": string?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "byte": byte.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "binary": binary?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "date": date?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "dateTime": dateTime?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "password": password?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "integer": integer, + "int32": int32, + "int64": int64, + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date, + "dateTime": dateTime, + "password": password, + "callback": callback, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -519,24 +519,24 @@ import Foundation let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": (wrappedValue: enumQueryStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_string": (wrappedValue: enumQueryString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_integer": (wrappedValue: enumQueryInteger?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_double": (wrappedValue: enumQueryDouble?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "enum_query_string_array": (wrappedValue: enumQueryStringArray, isExplode: false), + "enum_query_string": (wrappedValue: enumQueryString, isExplode: false), + "enum_query_integer": (wrappedValue: enumQueryInteger, isExplode: false), + "enum_query_double": (wrappedValue: enumQueryDouble, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ "Content-Type": "application/x-www-form-urlencoded", - "enum_header_string_array": enumHeaderStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_header_string": enumHeaderString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -590,15 +590,15 @@ import Foundation var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": (wrappedValue: requiredStringGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "required_int64_group": (wrappedValue: requiredInt64Group.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "string_group": (wrappedValue: stringGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "int64_group": (wrappedValue: int64Group?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "required_string_group": (wrappedValue: requiredStringGroup, isExplode: false), + "required_int64_group": (wrappedValue: requiredInt64Group, isExplode: false), + "string_group": (wrappedValue: stringGroup, isExplode: false), + "int64_group": (wrappedValue: int64Group, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "boolean_group": booleanGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -684,11 +684,11 @@ import Foundation let localVariablePath = "/fake/jsonFormData" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "param": param.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "param": param, + "param2": param2, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/PetAPI.swift index 29a1588f4b14..2f9ab5c7e3b8 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/PetAPI.swift @@ -101,7 +101,7 @@ import Foundation let localVariableUrlComponents = URLComponents(string: localVariableURLString) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "api_key": apiKey?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "api_key": apiKey, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -157,7 +157,7 @@ import Foundation var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": (wrappedValue: status.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "status": (wrappedValue: status, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -210,7 +210,7 @@ import Foundation var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": (wrappedValue: tags.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "tags": (wrappedValue: tags, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -362,11 +362,11 @@ import Foundation localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "name": name?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "name": name, + "status": status, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -421,11 +421,11 @@ import Foundation localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "file": file, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -480,11 +480,11 @@ import Foundation localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/UserAPI.swift index e73cf4d9c604..a48ec49522af 100644 --- a/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/objcCompatible/Sources/PetstoreClient/APIs/UserAPI.swift @@ -273,8 +273,8 @@ import Foundation var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": (wrappedValue: username.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "password": (wrappedValue: password.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "username": (wrappedValue: username, isExplode: false), + "password": (wrappedValue: password, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index a13ed0afbebb..c6a4fee7866d 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -264,7 +264,7 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": (wrappedValue: query.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "query": (wrappedValue: query, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -385,23 +385,23 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "integer": integer?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int32": int32?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int64": int64?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "number": number.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "float": float?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "double": double.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "string": string?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "byte": byte.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "binary": binary?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "date": date?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "dateTime": dateTime?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "password": password?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "integer": integer, + "int32": int32, + "int64": int64, + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date, + "dateTime": dateTime, + "password": password, + "callback": callback, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -529,24 +529,24 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": (wrappedValue: enumQueryStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_string": (wrappedValue: enumQueryString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_integer": (wrappedValue: enumQueryInteger?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_double": (wrappedValue: enumQueryDouble?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "enum_query_string_array": (wrappedValue: enumQueryStringArray, isExplode: false), + "enum_query_string": (wrappedValue: enumQueryString, isExplode: false), + "enum_query_integer": (wrappedValue: enumQueryInteger, isExplode: false), + "enum_query_double": (wrappedValue: enumQueryDouble, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ "Content-Type": "application/x-www-form-urlencoded", - "enum_header_string_array": enumHeaderStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_header_string": enumHeaderString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -601,15 +601,15 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": (wrappedValue: requiredStringGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "required_int64_group": (wrappedValue: requiredInt64Group.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "string_group": (wrappedValue: stringGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "int64_group": (wrappedValue: int64Group?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "required_string_group": (wrappedValue: requiredStringGroup, isExplode: false), + "required_int64_group": (wrappedValue: requiredInt64Group, isExplode: false), + "string_group": (wrappedValue: stringGroup, isExplode: false), + "int64_group": (wrappedValue: int64Group, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "boolean_group": booleanGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -697,11 +697,11 @@ open class FakeAPI { let localVariablePath = "/fake/jsonFormData" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "param": param.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "param": param, + "param2": param2, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 13359e61373c..33e06990fc55 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -104,7 +104,7 @@ open class PetAPI { let localVariableUrlComponents = URLComponents(string: localVariableURLString) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "api_key": apiKey?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "api_key": apiKey, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -161,7 +161,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": (wrappedValue: status.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "status": (wrappedValue: status, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -215,7 +215,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": (wrappedValue: tags.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "tags": (wrappedValue: tags, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -370,11 +370,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "name": name?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "name": name, + "status": status, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -430,11 +430,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "file": file, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -490,11 +490,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index be766b2c5e43..cbd10bf13061 100644 --- a/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -280,8 +280,8 @@ open class UserAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": (wrappedValue: username.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "password": (wrappedValue: password.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "username": (wrappedValue: username, isExplode: false), + "password": (wrappedValue: password, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 54bcbedc355b..1fd2606cbfed 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -257,7 +257,7 @@ internal class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": (wrappedValue: query.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "query": (wrappedValue: query, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -376,23 +376,23 @@ internal class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "integer": integer?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int32": int32?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int64": int64?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "number": number.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "float": float?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "double": double.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "string": string?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "byte": byte.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "binary": binary?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "date": date?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "dateTime": dateTime?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "password": password?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "integer": integer, + "int32": int32, + "int64": int64, + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date, + "dateTime": dateTime, + "password": password, + "callback": callback, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -519,24 +519,24 @@ internal class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": (wrappedValue: enumQueryStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_string": (wrappedValue: enumQueryString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_integer": (wrappedValue: enumQueryInteger?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_double": (wrappedValue: enumQueryDouble?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "enum_query_string_array": (wrappedValue: enumQueryStringArray, isExplode: false), + "enum_query_string": (wrappedValue: enumQueryString, isExplode: false), + "enum_query_integer": (wrappedValue: enumQueryInteger, isExplode: false), + "enum_query_double": (wrappedValue: enumQueryDouble, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ "Content-Type": "application/x-www-form-urlencoded", - "enum_header_string_array": enumHeaderStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_header_string": enumHeaderString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -590,15 +590,15 @@ internal class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": (wrappedValue: requiredStringGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "required_int64_group": (wrappedValue: requiredInt64Group.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "string_group": (wrappedValue: stringGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "int64_group": (wrappedValue: int64Group?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "required_string_group": (wrappedValue: requiredStringGroup, isExplode: false), + "required_int64_group": (wrappedValue: requiredInt64Group, isExplode: false), + "string_group": (wrappedValue: stringGroup, isExplode: false), + "int64_group": (wrappedValue: int64Group, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "boolean_group": booleanGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -684,11 +684,11 @@ internal class FakeAPI { let localVariablePath = "/fake/jsonFormData" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "param": param.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "param": param, + "param2": param2, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 2136615a4ec3..ab4f56c1dd3f 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -101,7 +101,7 @@ internal class PetAPI { let localVariableUrlComponents = URLComponents(string: localVariableURLString) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "api_key": apiKey?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "api_key": apiKey, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -157,7 +157,7 @@ internal class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": (wrappedValue: status.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "status": (wrappedValue: status, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -210,7 +210,7 @@ internal class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": (wrappedValue: tags.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "tags": (wrappedValue: tags, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -362,11 +362,11 @@ internal class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "name": name?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "name": name, + "status": status, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -421,11 +421,11 @@ internal class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "file": file, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -480,11 +480,11 @@ internal class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 51ff300b3346..dfc4cc216563 100644 --- a/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -273,8 +273,8 @@ internal class UserAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": (wrappedValue: username.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "password": (wrappedValue: password.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "username": (wrappedValue: username, isExplode: false), + "password": (wrappedValue: password, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index a005ffc8a566..bea5dee5b687 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -294,7 +294,7 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": (wrappedValue: query.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "query": (wrappedValue: query, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -425,23 +425,23 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "integer": integer?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int32": int32?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int64": int64?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "number": number.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "float": float?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "double": double.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "string": string?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "byte": byte.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "binary": binary?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "date": date?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "dateTime": dateTime?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "password": password?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "integer": integer, + "int32": int32, + "int64": int64, + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date, + "dateTime": dateTime, + "password": password, + "callback": callback, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -574,24 +574,24 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": (wrappedValue: enumQueryStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_string": (wrappedValue: enumQueryString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_integer": (wrappedValue: enumQueryInteger?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_double": (wrappedValue: enumQueryDouble?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "enum_query_string_array": (wrappedValue: enumQueryStringArray, isExplode: false), + "enum_query_string": (wrappedValue: enumQueryString, isExplode: false), + "enum_query_integer": (wrappedValue: enumQueryInteger, isExplode: false), + "enum_query_double": (wrappedValue: enumQueryDouble, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ "Content-Type": "application/x-www-form-urlencoded", - "enum_header_string_array": enumHeaderStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_header_string": enumHeaderString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -651,15 +651,15 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": (wrappedValue: requiredStringGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "required_int64_group": (wrappedValue: requiredInt64Group.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "string_group": (wrappedValue: stringGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "int64_group": (wrappedValue: int64Group?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "required_string_group": (wrappedValue: requiredStringGroup, isExplode: false), + "required_int64_group": (wrappedValue: requiredInt64Group, isExplode: false), + "string_group": (wrappedValue: stringGroup, isExplode: false), + "int64_group": (wrappedValue: int64Group, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "boolean_group": booleanGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -757,11 +757,11 @@ open class FakeAPI { let localVariablePath = "/fake/jsonFormData" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "param": param.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "param": param, + "param2": param2, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index baa880cc0fb8..d64aac3d5740 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -114,7 +114,7 @@ open class PetAPI { let localVariableUrlComponents = URLComponents(string: localVariableURLString) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "api_key": apiKey?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "api_key": apiKey, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -176,7 +176,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": (wrappedValue: status.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "status": (wrappedValue: status, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -235,7 +235,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": (wrappedValue: tags.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "tags": (wrappedValue: tags, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -405,11 +405,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "name": name?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "name": name, + "status": status, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -470,11 +470,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "file": file, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -535,11 +535,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index cd06a791142b..8deb45b7cb29 100644 --- a/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -310,8 +310,8 @@ open class UserAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": (wrappedValue: username.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "password": (wrappedValue: password.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "username": (wrappedValue: username, isExplode: false), + "password": (wrappedValue: password, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index 2d5e37f104cc..d3bf310515be 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -260,7 +260,7 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": (wrappedValue: query.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "query": (wrappedValue: query, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -379,23 +379,23 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "integer": integer?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int32": int32?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "int64": int64?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "number": number.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "float": float?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "double": double.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "string": string?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "byte": byte.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "binary": binary?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "date": date?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "dateTime": dateTime?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "password": password?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "callback": callback?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "integer": integer, + "int32": int32, + "int64": int64, + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date, + "dateTime": dateTime, + "password": password, + "callback": callback, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -522,24 +522,24 @@ open class FakeAPI { let localVariablePath = "/fake" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_form_string": enumFormString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": (wrappedValue: enumQueryStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_string": (wrappedValue: enumQueryString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_integer": (wrappedValue: enumQueryInteger?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "enum_query_double": (wrappedValue: enumQueryDouble?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "enum_query_string_array": (wrappedValue: enumQueryStringArray, isExplode: false), + "enum_query_string": (wrappedValue: enumQueryString, isExplode: false), + "enum_query_integer": (wrappedValue: enumQueryInteger, isExplode: false), + "enum_query_double": (wrappedValue: enumQueryDouble, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ "Content-Type": "application/x-www-form-urlencoded", - "enum_header_string_array": enumHeaderStringArray?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "enum_header_string": enumHeaderString?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -593,15 +593,15 @@ open class FakeAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": (wrappedValue: requiredStringGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "required_int64_group": (wrappedValue: requiredInt64Group.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "string_group": (wrappedValue: stringGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "int64_group": (wrappedValue: int64Group?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "required_string_group": (wrappedValue: requiredStringGroup, isExplode: false), + "required_int64_group": (wrappedValue: requiredInt64Group, isExplode: false), + "string_group": (wrappedValue: stringGroup, isExplode: false), + "int64_group": (wrappedValue: int64Group, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "boolean_group": booleanGroup?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "required_boolean_group": requiredBooleanGroup, + "boolean_group": booleanGroup, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -687,11 +687,11 @@ open class FakeAPI { let localVariablePath = "/fake/jsonFormData" let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "param": param.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "param2": param2.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "param": param, + "param2": param2, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index 814594e598c8..7558e3d7e7f3 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -104,7 +104,7 @@ open class PetAPI { let localVariableUrlComponents = URLComponents(string: localVariableURLString) let localVariableNillableHeaders: [String: (any Sendable)?] = [ - "api_key": apiKey?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "api_key": apiKey, ] let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders) @@ -160,7 +160,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": (wrappedValue: status.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "status": (wrappedValue: status, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -213,7 +213,7 @@ open class PetAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": (wrappedValue: tags.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "tags": (wrappedValue: tags, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [ @@ -365,11 +365,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "name": name?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "status": status?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "name": name, + "status": status, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -424,11 +424,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "file": file?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "file": file, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) @@ -483,11 +483,11 @@ open class PetAPI { localVariablePath = localVariablePath.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let localVariableURLString = apiConfiguration.basePath + localVariablePath let localVariableFormParams: [String: (any Sendable)?] = [ - "additionalMetadata": additionalMetadata?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), - "requiredFile": requiredFile.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), + "additionalMetadata": additionalMetadata, + "requiredFile": requiredFile, ] - let localVariableParameters = APIHelper.rejectNil(localVariableFormParams) + let localVariableParameters = APIHelper.rejectNil(localVariableFormParams)?.encodeToQueryString(codableHelper: apiConfiguration.codableHelper) let localVariableUrlComponents = URLComponents(string: localVariableURLString) diff --git a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift index 9cabb7e1cccf..586e0f73dbd1 100644 --- a/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift6/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift @@ -276,8 +276,8 @@ open class UserAPI { var localVariableUrlComponents = URLComponents(string: localVariableURLString) localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": (wrappedValue: username.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), - "password": (wrappedValue: password.encodeToQueryString(codableHelper: apiConfiguration.codableHelper), isExplode: false), + "username": (wrappedValue: username, isExplode: false), + "password": (wrappedValue: password, isExplode: false), ]) let localVariableNillableHeaders: [String: (any Sendable)?] = [