Skip to content

Commit 31fa50a

Browse files
authored
Make error message for missing "openapi" key clearer. (#678)
1 parent ecce1b7 commit 31fa50a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/_OpenAPIGeneratorCore/Parser/YamsParser.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ extension Diagnostic {
139139
static func openAPIMissingVersionError(location: Location) -> Diagnostic {
140140
error(
141141
message:
142-
"No openapi key found, please provide a valid OpenAPI document with OpenAPI versions in the 3.0.x or 3.1.x sets.",
142+
"No key named openapi found. Please provide a valid OpenAPI document with OpenAPI versions in the 3.0.x or 3.1.x sets.",
143143
location: location
144144
)
145145
}

Tests/OpenAPIGeneratorCoreTests/Parser/Test_YamsParser.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ final class Test_YamsParser: Test_Core {
5656
"""
5757

5858
let expected =
59-
"/foo.yaml: error: No openapi key found, please provide a valid OpenAPI document with OpenAPI versions in the 3.0.x or 3.1.x sets."
59+
"/foo.yaml: error: No key named openapi found. Please provide a valid OpenAPI document with OpenAPI versions in the 3.0.x or 3.1.x sets."
6060
assertThrownError(try _test(yaml), expectedDiagnostic: expected)
6161
}
6262

0 commit comments

Comments
 (0)