Skip to content

Commit 73ed655

Browse files
committed
Adding support for UUID type
1 parent 7c36ba9 commit 73ed655

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Sources/_OpenAPIGeneratorCore/Translator/CommonTypes/Constants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ enum Constants {
2828
ImportDescription(moduleName: "OpenAPIRuntime", spi: "Generated"),
2929
ImportDescription(
3030
moduleName: "Foundation",
31-
moduleTypes: ["struct Foundation.URL", "struct Foundation.Data", "struct Foundation.Date"],
31+
moduleTypes: ["struct Foundation.URL", "struct Foundation.Data", "struct Foundation.Date", "struct Foundation.UUID"],
3232
preconcurrency: .onOS(["Linux"])
3333
),
3434
]

Sources/_OpenAPIGeneratorCore/Translator/TypeAssignment/Builtins.swift

Lines changed: 3 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ struct TypeMatcher {
316316
default:
317317
switch core.format {
318318
case .dateTime: typeName = .date
319+
case .uuid: typeName = .uuid
319320
default: typeName = .string
320321
}
321322
}

0 commit comments

Comments
 (0)