diff --git a/bin/configs/swift5-objcCompatible.yaml b/bin/configs/swift5-objcCompatible.yaml
index deb33907cc48..c6f878d2c358 100644
--- a/bin/configs/swift5-objcCompatible.yaml
+++ b/bin/configs/swift5-objcCompatible.yaml
@@ -5,6 +5,7 @@ templateDir: modules/openapi-generator/src/main/resources/swift5
generateAliasAsModel: true
additionalProperties:
podAuthors: ""
+ identifiableModels: false
podSummary: PetstoreClient
objcCompatible: true
projectName: PetstoreClient
diff --git a/docs/generators/swift5.md b/docs/generators/swift5.md
index f1624cb68289..a46bd33730f3 100644
--- a/docs/generators/swift5.md
+++ b/docs/generators/swift5.md
@@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|generateModelAdditionalProperties|Generate model additional properties (default: true)| |true|
|hashableModels|Make hashable models (default: true)| |true|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
+|identifiableModels|Make models conform to Identifiable when an id is present (default: true)| |true|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|
- **true**
- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
- **false**
- The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true|
|library|Library template (sub-template) to use|- **urlsession**
- [DEFAULT] HTTP client: URLSession
- **alamofire**
- HTTP client: Alamofire
- **vapor**
- HTTP client: Vapor
|urlsession|
|mapFileBinaryToData|[WARNING] This option will be removed and enabled by default in the future once we've enhanced the code to work with `Data` in all the different situations. Map File and Binary to Data (default: false)| |false|
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java
index 41b2a70d6156..16ce68597cbb 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java
@@ -70,6 +70,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig
public static final String USE_BACKTICK_ESCAPES = "useBacktickEscapes";
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";
@@ -95,6 +96,7 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig
@Setter protected boolean useBacktickEscapes = false;
@Setter protected boolean generateModelAdditionalProperties = true;
@Setter protected boolean hashableModels = true;
+ @Setter protected boolean identifiableModels = true;
@Setter protected boolean useJsonEncodable = true;
@Getter @Setter
protected boolean mapFileBinaryToData = false;
@@ -303,6 +305,10 @@ public Swift5ClientCodegen() {
"Make hashable models (default: true)")
.defaultValue(Boolean.TRUE.toString()));
+ cliOptions.add(new CliOption(IDENTIFIABLE_MODELS,
+ "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()));
@@ -507,6 +513,11 @@ public void processOpts() {
}
additionalProperties.put(HASHABLE_MODELS, hashableModels);
+ if (additionalProperties.containsKey(IDENTIFIABLE_MODELS)) {
+ setIdentifiableModels(convertPropertyToBooleanAndWriteBack(IDENTIFIABLE_MODELS));
+ }
+ additionalProperties.put(IDENTIFIABLE_MODELS, identifiableModels);
+
if (additionalProperties.containsKey(USE_JSON_ENCODABLE)) {
setUseJsonEncodable(convertPropertyToBooleanAndWriteBack(USE_JSON_ENCODABLE));
}
@@ -940,6 +951,15 @@ public CodegenModel fromModel(String name, Schema model) {
if (hashableModels) {
codegenModel.vendorExtensions.put("x-swift-hashable", true);
}
+ if (identifiableModels && !codegenModel.vendorExtensions.containsKey("x-swift-identifiable")) {
+ for (CodegenProperty cp : codegenModel.getVars()) {
+ if (!cp.getBaseName().equals("id")) continue;
+ if (cp.isString || cp.isUuid || cp.isInteger || cp.isLong) {
+ codegenModel.vendorExtensions.put("x-swift-identifiable", true);
+ break;
+ }
+ }
+ }
return codegenModel;
}
diff --git a/modules/openapi-generator/src/main/resources/swift5/model.mustache b/modules/openapi-generator/src/main/resources/swift5/model.mustache
index b6a725d05262..4a77dc7aca91 100644
--- a/modules/openapi-generator/src/main/resources/swift5/model.mustache
+++ b/modules/openapi-generator/src/main/resources/swift5/model.mustache
@@ -27,4 +27,7 @@ extension {{projectName}}API {
{{> modelObject}}{{/isEnum}}{{/isArray}}{{/vendorExtensions.x-is-one-of-interface}}{{/model}}{{/models}}
{{#swiftUseApiNamespace}}
}
-{{/swiftUseApiNamespace}}
\ No newline at end of file
+{{/swiftUseApiNamespace}}{{#models}}{{#model}}{{#vendorExtensions.x-swift-identifiable}}
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension {{#swiftUseApiNamespace}}{{projectName}}API.{{/swiftUseApiNamespace}}{{{classname}}}: Identifiable {}
+{{/vendorExtensions.x-swift-identifiable}}{{/model}}{{/models}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java
index 35dd0de4ff13..d9a2135a9ef9 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java
@@ -47,6 +47,7 @@ public class Swift5OptionsProvider implements OptionsProvider {
public static final String USE_BACKTICKS_ESCAPES_VALUE = "false";
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";
@@ -94,6 +95,7 @@ public Map createOptions() {
.put(Swift5ClientCodegen.SWIFT_PACKAGE_PATH, SWIFT_PACKAGE_PATH_VALUE)
.put(Swift5ClientCodegen.GENERATE_MODEL_ADDITIONAL_PROPERTIES, GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE)
.put(Swift5ClientCodegen.HASHABLE_MODELS, HASHABLE_MODELS_VALUE)
+ .put(Swift5ClientCodegen.IDENTIFIABLE_MODELS, IDENTIFIABLE_MODELS_VALUE)
.put(Swift5ClientCodegen.USE_JSON_ENCODABLE, USE_JSON_ENCODABLE_VALUE)
.put(Swift5ClientCodegen.MAP_FILE_BINARY_TO_DATA, "false")
.put(Swift5ClientCodegen.USE_CUSTOM_DATE_WITHOUT_TIME, "false")
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java
index fdea21bdd8e8..0068dad8a06b 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java
@@ -45,6 +45,7 @@ protected void verifyOptions() {
verify(clientCodegen).setResponseAs(Swift5OptionsProvider.RESPONSE_AS_VALUE.split(","));
verify(clientCodegen).setNonPublicApi(Boolean.parseBoolean(Swift5OptionsProvider.NON_PUBLIC_API_REQUIRED_VALUE));
verify(clientCodegen).setObjcCompatible(Boolean.parseBoolean(Swift5OptionsProvider.OBJC_COMPATIBLE_VALUE));
+ verify(clientCodegen).setIdentifiableModels(Boolean.parseBoolean(Swift5OptionsProvider.IDENTIFIABLE_MODELS_VALUE));
verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(Swift5OptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE));
verify(clientCodegen).setReadonlyProperties(Boolean.parseBoolean(Swift5OptionsProvider.READONLY_PROPERTIES_VALUE));
verify(clientCodegen).setGenerateModelAdditionalProperties(Boolean.parseBoolean(Swift5OptionsProvider.GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE));
diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
index 75b68ec01e27..4ca1c99c7b3e 100644
--- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
+++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
@@ -34,3 +34,6 @@ public struct Category: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Category: Identifiable {}
diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
index bf7da6a3f862..81dfbd65cd11 100644
--- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
+++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
@@ -56,3 +56,6 @@ public struct Order: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Order: Identifiable {}
diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
index f93b402b0fd5..6a8ade6b1fc9 100644
--- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
+++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
@@ -59,3 +59,6 @@ public struct Pet: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Pet: Identifiable {}
diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
index f2dea74b09d8..9105e00c49a2 100644
--- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
+++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
@@ -34,3 +34,6 @@ public struct Tag: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Tag: Identifiable {}
diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
index e55b50dc4f73..c0e99a75c26d 100644
--- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
+++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
@@ -59,3 +59,6 @@ public struct User: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension User: Identifiable {}
diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
index 75b68ec01e27..4ca1c99c7b3e 100644
--- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
+++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
@@ -34,3 +34,6 @@ public struct Category: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Category: Identifiable {}
diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
index bf7da6a3f862..81dfbd65cd11 100644
--- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
+++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
@@ -56,3 +56,6 @@ public struct Order: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Order: Identifiable {}
diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
index f93b402b0fd5..6a8ade6b1fc9 100644
--- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
+++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
@@ -59,3 +59,6 @@ public struct Pet: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Pet: Identifiable {}
diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
index f2dea74b09d8..9105e00c49a2 100644
--- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
+++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
@@ -34,3 +34,6 @@ public struct Tag: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Tag: Identifiable {}
diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
index e55b50dc4f73..c0e99a75c26d 100644
--- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
+++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
@@ -59,3 +59,6 @@ public struct User: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension User: Identifiable {}
diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
index 75b68ec01e27..4ca1c99c7b3e 100644
--- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
+++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
@@ -34,3 +34,6 @@ public struct Category: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Category: Identifiable {}
diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
index bf7da6a3f862..81dfbd65cd11 100644
--- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
+++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
@@ -56,3 +56,6 @@ public struct Order: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Order: Identifiable {}
diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
index f93b402b0fd5..6a8ade6b1fc9 100644
--- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
+++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
@@ -59,3 +59,6 @@ public struct Pet: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Pet: Identifiable {}
diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
index f2dea74b09d8..9105e00c49a2 100644
--- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
+++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
@@ -34,3 +34,6 @@ public struct Tag: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Tag: Identifiable {}
diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
index e55b50dc4f73..c0e99a75c26d 100644
--- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
+++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
@@ -59,3 +59,6 @@ public struct User: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension User: Identifiable {}
diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
index 80ac2aeaf8b2..9510c15aa368 100644
--- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
+++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
@@ -34,3 +34,6 @@ public struct Category: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Category: Identifiable {}
diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
index 818233c5fcee..f506e9c0a917 100644
--- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
+++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
@@ -56,3 +56,6 @@ public struct Order: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Order: Identifiable {}
diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
index 394619c072c6..899d354127a6 100644
--- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
+++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
@@ -57,3 +57,6 @@ public struct Pet: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Pet: Identifiable {}
diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
index f2dea74b09d8..9105e00c49a2 100644
--- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
+++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
@@ -34,3 +34,6 @@ public struct Tag: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Tag: Identifiable {}
diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift
index e55b50dc4f73..c0e99a75c26d 100644
--- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift
+++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift
@@ -59,3 +59,6 @@ public struct User: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension User: Identifiable {}
diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
index 75b68ec01e27..4ca1c99c7b3e 100644
--- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
+++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
@@ -34,3 +34,6 @@ public struct Category: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Category: Identifiable {}
diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
index bf7da6a3f862..81dfbd65cd11 100644
--- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
+++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
@@ -56,3 +56,6 @@ public struct Order: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Order: Identifiable {}
diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
index f93b402b0fd5..6a8ade6b1fc9 100644
--- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
+++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
@@ -59,3 +59,6 @@ public struct Pet: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Pet: Identifiable {}
diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
index f2dea74b09d8..9105e00c49a2 100644
--- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
+++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
@@ -34,3 +34,6 @@ public struct Tag: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Tag: Identifiable {}
diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
index e55b50dc4f73..c0e99a75c26d 100644
--- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
+++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
@@ -59,3 +59,6 @@ public struct User: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension User: Identifiable {}
diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
index 012090297b21..eaf3ff5f60f8 100644
--- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
+++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
@@ -34,3 +34,6 @@ internal struct Category: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Category: Identifiable {}
diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
index 78eb1c3d8ce0..ed296f7a5d82 100644
--- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
+++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
@@ -57,3 +57,6 @@ internal struct Order: Codable, JSONEncodable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Order: Identifiable {}
diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
index 26cc4e5eee24..6bf8f949388b 100644
--- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
+++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
@@ -60,3 +60,6 @@ internal struct Pet: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Pet: Identifiable {}
diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
index fc36965c2eb3..367424ff8055 100644
--- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
+++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
@@ -34,3 +34,6 @@ internal struct Tag: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Tag: Identifiable {}
diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
index fa481cd187da..1a916c3e714e 100644
--- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
+++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
@@ -59,3 +59,6 @@ internal struct User: Codable, JSONEncodable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension User: Identifiable {}
diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
index 75b68ec01e27..4ca1c99c7b3e 100644
--- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
+++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift
@@ -34,3 +34,6 @@ public struct Category: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Category: Identifiable {}
diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
index bf7da6a3f862..81dfbd65cd11 100644
--- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
+++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift
@@ -56,3 +56,6 @@ public struct Order: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Order: Identifiable {}
diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
index f93b402b0fd5..6a8ade6b1fc9 100644
--- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
+++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift
@@ -59,3 +59,6 @@ public struct Pet: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Pet: Identifiable {}
diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
index f2dea74b09d8..9105e00c49a2 100644
--- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
+++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift
@@ -34,3 +34,6 @@ public struct Tag: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Tag: Identifiable {}
diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
index e55b50dc4f73..c0e99a75c26d 100644
--- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
+++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift
@@ -59,3 +59,6 @@ public struct User: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension User: Identifiable {}
diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift
index 90eec24e2a68..7ad46f0429df 100644
--- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift
+++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Category.swift
@@ -52,3 +52,6 @@ public final class Category: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension PetstoreClientAPI.Category: Identifiable {}
diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift
index 6a9c4ec8937d..1475a14e627b 100644
--- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift
+++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Order.swift
@@ -82,3 +82,6 @@ public final class Order: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension PetstoreClientAPI.Order: Identifiable {}
diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift
index ee791a3947a4..7a9c21f75f10 100644
--- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift
+++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift
@@ -85,3 +85,6 @@ public final class Pet: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension PetstoreClientAPI.Pet: Identifiable {}
diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift
index fbb689857fcf..97d364c08038 100644
--- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift
+++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Tag.swift
@@ -52,3 +52,6 @@ public final class Tag: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension PetstoreClientAPI.Tag: Identifiable {}
diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift
index e0616cdca592..e793ae150e32 100644
--- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift
+++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/User.swift
@@ -89,3 +89,6 @@ public final class User: Codable, JSONEncodable, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension PetstoreClientAPI.User: Identifiable {}
diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Category.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Category.swift
index ca2a487b438a..02e4490da8d9 100644
--- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Category.swift
+++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Category.swift
@@ -47,3 +47,6 @@ public final class Category: Content, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Category: Identifiable {}
diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Order.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Order.swift
index 7a7b357cd46e..e08a9c34b442 100644
--- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Order.swift
+++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Order.swift
@@ -77,3 +77,6 @@ public final class Order: Content, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Order: Identifiable {}
diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift
index 73c5b9d0b652..7a30afd16d2b 100644
--- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift
+++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Pet.swift
@@ -78,3 +78,6 @@ public final class Pet: Content, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Pet: Identifiable {}
diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift
index b6ec1244243d..3ae09c30f09e 100644
--- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift
+++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/Tag.swift
@@ -47,3 +47,6 @@ public final class Tag: Content, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension Tag: Identifiable {}
diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/User.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/User.swift
index 47e3f6fbcb30..297e6d784922 100644
--- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/User.swift
+++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/Models/User.swift
@@ -84,3 +84,6 @@ public final class User: Content, Hashable {
}
}
+
+@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
+extension User: Identifiable {}