Skip to content

Commit

Permalink
Make error message for missing "openapi" key clearer. (#678)
Browse files Browse the repository at this point in the history
  • Loading branch information
deirdresmtoo authored Nov 22, 2024
1 parent ecce1b7 commit 31fa50a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/_OpenAPIGeneratorCore/Parser/YamsParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ extension Diagnostic {
static func openAPIMissingVersionError(location: Location) -> Diagnostic {
error(
message:
"No openapi key found, please provide a valid OpenAPI document with OpenAPI versions in the 3.0.x or 3.1.x sets.",
"No key named openapi found. Please provide a valid OpenAPI document with OpenAPI versions in the 3.0.x or 3.1.x sets.",
location: location
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ final class Test_YamsParser: Test_Core {
"""

let expected =
"/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."
"/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."
assertThrownError(try _test(yaml), expectedDiagnostic: expected)
}

Expand Down

0 comments on commit 31fa50a

Please sign in to comment.