Skip to content

Commit 5c79d38

Browse files
committed
Adding support for UUID type
1 parent f1d7d8b commit 5c79d38

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Sources/_OpenAPIGeneratorCore/Translator/CommonTypes/Constants.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum Constants {
3838
ImportDescription(moduleName: Constants.Import.runtime, spi: "Generated"),
3939
ImportDescription(
4040
moduleName: "Foundation",
41-
moduleTypes: ["struct Foundation.URL", "struct Foundation.Data", "struct Foundation.Date"],
41+
moduleTypes: ["struct Foundation.URL", "struct Foundation.Data", "struct Foundation.Date", "struct Foundation.UUID"],
4242
preconcurrency: .onOS(["Linux"])
4343
),
4444
]

Sources/_OpenAPIGeneratorCore/Translator/TypeAssignment/Builtins.swift

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ extension TypeName {
5050
/// Returns the type name for the URL type.
5151
static var url: Self { .foundation("URL") }
5252

53+
/// Returns the type name for the UUID type.
54+
static var uuid: Self { .foundation("UUID") }
55+
5356
/// Returns the type name for the DecodingError type.
5457
static var decodingError: Self { .swift("DecodingError") }
5558

Sources/_OpenAPIGeneratorCore/Translator/TypeAssignment/TypeMatcher.swift

+1
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ struct TypeMatcher {
313313
default:
314314
switch core.format {
315315
case .dateTime: typeName = .date
316+
case .uuid: typeName = .uuid
316317
default: typeName = .string
317318
}
318319
}

0 commit comments

Comments
 (0)