Skip to content

Commit 0578e13

Browse files
committed
[swift6] Add Identifiable conformance to supported models
1 parent 18b01ca commit 0578e13

File tree

60 files changed

+140
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+140
-2
lines changed

bin/configs/swift6-objcCompatible.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ generateAliasAsModel: true
66
additionalProperties:
77
responseAs: ObjcBlock
88
podAuthors: ""
9+
identifiableModels: false
910
podSummary: PetstoreClient
1011
objcCompatible: true
1112
projectName: PetstoreClient

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift6ClientCodegen.java

+20
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public class Swift6ClientCodegen extends DefaultCodegen implements CodegenConfig
7070
public static final String USE_BACKTICK_ESCAPES = "useBacktickEscapes";
7171
public static final String GENERATE_MODEL_ADDITIONAL_PROPERTIES = "generateModelAdditionalProperties";
7272
public static final String HASHABLE_MODELS = "hashableModels";
73+
public static final String IDENTIFIABLE_MODELS = "identifiableModels";
7374
public static final String USE_JSON_ENCODABLE = "useJsonEncodable";
7475
public static final String MAP_FILE_BINARY_TO_DATA = "mapFileBinaryToData";
7576
public static final String USE_CUSTOM_DATE_WITHOUT_TIME = "useCustomDateWithoutTime";
@@ -98,6 +99,7 @@ public class Swift6ClientCodegen extends DefaultCodegen implements CodegenConfig
9899
@Setter protected boolean useBacktickEscapes = false;
99100
@Setter protected boolean generateModelAdditionalProperties = true;
100101
@Setter protected boolean hashableModels = true;
102+
@Setter protected boolean identifiableModels = true;
101103
@Setter protected boolean useJsonEncodable = true;
102104
@Getter @Setter protected boolean mapFileBinaryToData = false;
103105
@Setter protected boolean useCustomDateWithoutTime = false;
@@ -307,6 +309,10 @@ public Swift6ClientCodegen() {
307309
"Make hashable models (default: true)")
308310
.defaultValue(Boolean.TRUE.toString()));
309311

312+
cliOptions.add(new CliOption(IDENTIFIABLE_MODELS,
313+
"Make models conform to Identifiable when an id is present (default: true)")
314+
.defaultValue(Boolean.TRUE.toString()));
315+
310316
cliOptions.add(new CliOption(USE_JSON_ENCODABLE,
311317
"Make models conform to JSONEncodable protocol (default: true)")
312318
.defaultValue(Boolean.TRUE.toString()));
@@ -527,6 +533,11 @@ public void processOpts() {
527533
}
528534
additionalProperties.put(HASHABLE_MODELS, hashableModels);
529535

536+
if (additionalProperties.containsKey(IDENTIFIABLE_MODELS)) {
537+
setIdentifiableModels(convertPropertyToBooleanAndWriteBack(IDENTIFIABLE_MODELS));
538+
}
539+
additionalProperties.put(IDENTIFIABLE_MODELS, identifiableModels);
540+
530541
if (additionalProperties.containsKey(USE_JSON_ENCODABLE)) {
531542
setUseJsonEncodable(convertPropertyToBooleanAndWriteBack(USE_JSON_ENCODABLE));
532543
}
@@ -973,6 +984,15 @@ public CodegenModel fromModel(String name, Schema model) {
973984
if (hashableModels) {
974985
codegenModel.vendorExtensions.put("x-swift-hashable", true);
975986
}
987+
if (identifiableModels && !codegenModel.vendorExtensions.containsKey("x-swift-identifiable")) {
988+
for (CodegenProperty cp : codegenModel.getVars()) {
989+
if (!cp.getBaseName().equals("id")) continue;
990+
if (cp.isString || cp.isUuid || cp.isInteger || cp.isLong) {
991+
codegenModel.vendorExtensions.put("x-swift-identifiable", true);
992+
break;
993+
}
994+
}
995+
}
976996
return codegenModel;
977997
}
978998

modules/openapi-generator/src/main/resources/swift6/modelObject.mustache

+4
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,7 @@
135135
{{#generateModelAdditionalProperties}}{{#additionalPropertiesType}}hasher.combine(additionalProperties.hashValue){{/additionalPropertiesType}}{{/generateModelAdditionalProperties}}
136136
}{{/vendorExtensions.x-swift-hashable}}{{/useClasses}}{{/objcCompatible}}
137137
}
138+
{{#vendorExtensions.x-swift-identifiable}}
139+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
140+
extension {{{classname}}}: Identifiable {}
141+
{{/vendorExtensions.x-swift-identifiable}}

modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift6ClientCodegenOptionsProvider.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public class Swift6ClientCodegenOptionsProvider implements OptionsProvider {
4848
public static final String USE_BACKTICKS_ESCAPES_VALUE = "false";
4949
public static final String GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE = "true";
5050
public static final String HASHABLE_MODELS_VALUE = "true";
51+
public static final String IDENTIFIABLE_MODELS_VALUE = "true";
5152
public static final String USE_JSON_ENCODABLE_VALUE = "true";
5253
public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false";
5354
public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true";
@@ -98,15 +99,16 @@ public Map<String, String> createOptions() {
9899
.put(Swift6ClientCodegen.GENERATE_MODEL_ADDITIONAL_PROPERTIES,
99100
GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE)
100101
.put(Swift6ClientCodegen.HASHABLE_MODELS, HASHABLE_MODELS_VALUE)
102+
.put(Swift6ClientCodegen.IDENTIFIABLE_MODELS, IDENTIFIABLE_MODELS_VALUE)
101103
.put(Swift6ClientCodegen.USE_JSON_ENCODABLE, USE_JSON_ENCODABLE_VALUE)
102104
.put(Swift6ClientCodegen.MAP_FILE_BINARY_TO_DATA, "false")
103105
.put(Swift6ClientCodegen.USE_CUSTOM_DATE_WITHOUT_TIME, "false")
104106
.put(Swift6ClientCodegen.VALIDATABLE, "true")
105107
.put(Swift6ClientCodegen.ONE_OF_UNKNOWN_DEFAULT_CASE, "false")
106108
.put(Swift6ClientCodegen.USE_CLASSES, "false")
107-
.put(Swift6ClientCodegen.API_STATIC_METHOD,
109+
.put(Swift6ClientCodegen.API_STATIC_METHOD,
108110
API_STATIC_METHOD_VALUE)
109-
.put(Swift6ClientCodegen.COMBINE_DEFERRED,
111+
.put(Swift6ClientCodegen.COMBINE_DEFERRED,
110112
COMBINE_DEFERRED_VALUE)
111113
.put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE)
112114
.build();

modules/openapi-generator/src/test/java/org/openapitools/codegen/swift6/Swift6ClientCodegenOptionsTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ protected void verifyOptions() {
5353
verify(clientCodegen).setGenerateModelAdditionalProperties(
5454
Boolean.parseBoolean(Swift6ClientCodegenOptionsProvider.GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE));
5555
verify(clientCodegen).setHashableModels(Boolean.parseBoolean(Swift6ClientCodegenOptionsProvider.HASHABLE_MODELS_VALUE));
56+
verify(clientCodegen).setIdentifiableModels(Boolean.parseBoolean(Swift6ClientCodegenOptionsProvider.IDENTIFIABLE_MODELS_VALUE));
5657
verify(clientCodegen)
5758
.setEnumUnknownDefaultCase(Boolean.parseBoolean(Swift6ClientCodegenOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE));
5859
verify(clientCodegen).setApiStaticMethod(Boolean.parseBoolean(Swift6ClientCodegenOptionsProvider.API_STATIC_METHOD_VALUE));

samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Category.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public struct Category: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encode(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Category: Identifiable {}
3335

samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Order.swift

+2
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ public struct Order: Sendable, Codable, JSONEncodable, Hashable {
5252
try container.encodeIfPresent(complete, forKey: .complete)
5353
}
5454
}
55+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
56+
extension Order: Identifiable {}
5557

samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Pet.swift

+2
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ public struct Pet: Sendable, Codable, JSONEncodable, Hashable {
5555
}
5656
}
5757
}
58+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
59+
extension Pet: Identifiable {}
5860

samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/Tag.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public struct Tag: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encodeIfPresent(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Tag: Identifiable {}
3335

samples/client/petstore/swift6/alamofireLibrary/Sources/PetstoreClient/Models/User.swift

+2
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ public struct User: Sendable, Codable, JSONEncodable, Hashable {
5555
try container.encodeIfPresent(userStatus, forKey: .userStatus)
5656
}
5757
}
58+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
59+
extension User: Identifiable {}
5860

samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Category.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public struct Category: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encode(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Category: Identifiable {}
3335

samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Order.swift

+2
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ public struct Order: Sendable, Codable, JSONEncodable, Hashable {
5252
try container.encodeIfPresent(complete, forKey: .complete)
5353
}
5454
}
55+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
56+
extension Order: Identifiable {}
5557

samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Pet.swift

+2
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ public struct Pet: Sendable, Codable, JSONEncodable, Hashable {
5555
}
5656
}
5757
}
58+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
59+
extension Pet: Identifiable {}
5860

samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/Tag.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public struct Tag: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encodeIfPresent(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Tag: Identifiable {}
3335

samples/client/petstore/swift6/apiNonStaticMethod/Sources/PetstoreClient/Models/User.swift

+2
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ public struct User: Sendable, Codable, JSONEncodable, Hashable {
5555
try container.encodeIfPresent(userStatus, forKey: .userStatus)
5656
}
5757
}
58+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
59+
extension User: Identifiable {}
5860

samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Category.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public struct Category: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encode(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Category: Identifiable {}
3335

samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Order.swift

+2
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ public struct Order: Sendable, Codable, JSONEncodable, Hashable {
5252
try container.encodeIfPresent(complete, forKey: .complete)
5353
}
5454
}
55+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
56+
extension Order: Identifiable {}
5557

samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Pet.swift

+2
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ public struct Pet: Sendable, Codable, JSONEncodable, Hashable {
5555
}
5656
}
5757
}
58+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
59+
extension Pet: Identifiable {}
5860

samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/Tag.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public struct Tag: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encodeIfPresent(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Tag: Identifiable {}
3335

samples/client/petstore/swift6/asyncAwaitLibrary/Sources/PetstoreClient/Models/User.swift

+2
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ public struct User: Sendable, Codable, JSONEncodable, Hashable {
5555
try container.encodeIfPresent(userStatus, forKey: .userStatus)
5656
}
5757
}
58+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
59+
extension User: Identifiable {}
5860

samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public struct Category: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encode(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Category: Identifiable {}
3335

samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift

+2
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ public struct Order: Sendable, Codable, JSONEncodable, Hashable {
5252
try container.encodeIfPresent(complete, forKey: .complete)
5353
}
5454
}
55+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
56+
extension Order: Identifiable {}
5557

samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift

+2
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ public struct Pet: Sendable, Codable, JSONEncodable, Hashable {
5555
}
5656
}
5757
}
58+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
59+
extension Pet: Identifiable {}
5860

samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public struct Tag: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encodeIfPresent(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Tag: Identifiable {}
3335

samples/client/petstore/swift6/combineDeferredLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift

+2
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ public struct User: Sendable, Codable, JSONEncodable, Hashable {
5555
try container.encodeIfPresent(userStatus, forKey: .userStatus)
5656
}
5757
}
58+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
59+
extension User: Identifiable {}
5860

samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Category.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public struct Category: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encode(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Category: Identifiable {}
3335

samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Order.swift

+2
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ public struct Order: Sendable, Codable, JSONEncodable, Hashable {
5252
try container.encodeIfPresent(complete, forKey: .complete)
5353
}
5454
}
55+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
56+
extension Order: Identifiable {}
5557

samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Pet.swift

+2
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ public struct Pet: Sendable, Codable, JSONEncodable, Hashable {
5555
}
5656
}
5757
}
58+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
59+
extension Pet: Identifiable {}
5860

samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/Tag.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public struct Tag: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encodeIfPresent(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Tag: Identifiable {}
3335

samples/client/petstore/swift6/combineLibrary/Sources/CombineLibrary/Models/User.swift

+2
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ public struct User: Sendable, Codable, JSONEncodable, Hashable {
5555
try container.encodeIfPresent(userStatus, forKey: .userStatus)
5656
}
5757
}
58+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
59+
extension User: Identifiable {}
5860

samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Category.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public struct Category: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encode(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Category: Identifiable {}
3335

samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Order.swift

+2
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ public struct Order: Sendable, Codable, JSONEncodable, Hashable {
5252
try container.encodeIfPresent(complete, forKey: .complete)
5353
}
5454
}
55+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
56+
extension Order: Identifiable {}
5557

samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Pet.swift

+2
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,6 @@ public struct Pet: Sendable, Codable, JSONEncodable, Hashable {
5353
try container.encodeIfPresent(status, forKey: .status)
5454
}
5555
}
56+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
57+
extension Pet: Identifiable {}
5658

samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/Tag.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public struct Tag: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encodeIfPresent(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Tag: Identifiable {}
3335

samples/client/petstore/swift6/default/Sources/PetstoreClient/Models/User.swift

+2
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ public struct User: Sendable, Codable, JSONEncodable, Hashable {
5555
try container.encodeIfPresent(userStatus, forKey: .userStatus)
5656
}
5757
}
58+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
59+
extension User: Identifiable {}
5860

samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public struct Category: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encode(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Category: Identifiable {}
3335

samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift

+2
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,6 @@ public struct Order: Sendable, Codable, JSONEncodable, Hashable {
5252
try container.encodeIfPresent(complete, forKey: .complete)
5353
}
5454
}
55+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
56+
extension Order: Identifiable {}
5557

samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift

+2
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ public struct Pet: Sendable, Codable, JSONEncodable, Hashable {
5555
}
5656
}
5757
}
58+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
59+
extension Pet: Identifiable {}
5860

samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public struct Tag: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encodeIfPresent(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Tag: Identifiable {}
3335

samples/client/petstore/swift6/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift

+2
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ public struct User: Sendable, Codable, JSONEncodable, Hashable {
5555
try container.encodeIfPresent(userStatus, forKey: .userStatus)
5656
}
5757
}
58+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
59+
extension User: Identifiable {}
5860

samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ internal struct Category: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encode(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Category: Identifiable {}
3335

samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift

+2
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,6 @@ internal struct Order: Sendable, Codable, JSONEncodable {
5353
try container.encodeIfPresent(complete, forKey: .complete)
5454
}
5555
}
56+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
57+
extension Order: Identifiable {}
5658

samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift

+2
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,6 @@ internal struct Pet: Sendable, Codable, JSONEncodable, Hashable {
5656
}
5757
}
5858
}
59+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
60+
extension Pet: Identifiable {}
5961

samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ internal struct Tag: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encodeIfPresent(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Tag: Identifiable {}
3335

samples/client/petstore/swift6/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift

+2
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ internal struct User: Sendable, Codable, JSONEncodable {
5555
try container.encodeIfPresent(userStatus, forKey: .userStatus)
5656
}
5757
}
58+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
59+
extension User: Identifiable {}
5860

samples/client/petstore/swift6/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift

+2
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public struct Category: Sendable, Codable, JSONEncodable, Hashable {
3030
try container.encode(name, forKey: .name)
3131
}
3232
}
33+
@available(iOS 13, tvOS 13, watchOS 6, macOS 10.15, *)
34+
extension Category: Identifiable {}
3335

0 commit comments

Comments
 (0)