-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4003602
commit 99574ea
Showing
6 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
yq eval ' | ||
# Update OpenAPI version | ||
.openapi = "3.0.0" | | ||
# Delete `id`, it was renamed to $id | ||
del(.components.schemas.[].id) | | ||
# Delete annotations | ||
del(.. | select(has("annotations")).annotations) | | ||
# Update default values to match their type | ||
with(.. | select(.default? == "false"); .default = false) | | ||
with(.. | select(.default? == "true"); .default = true) | | ||
with(.. | select(.default? == "0"); .default = 0) | | ||
# Delete non-standard enumDescriptions and enumDeprecated | ||
del(.. | select(has("enumDescriptions")).enumDescriptions) | | ||
del(.. | select(has("enumDeprecated")).enumDeprecated) | | ||
# Update int64 to integer | ||
with(.. | select(.format? == "int64"); .type = "integer") | | ||
# Add error responses | ||
.paths.[].[]?.["responses"]? += {"4XX":{"description":"Failure response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleApiException"}}}}} | | ||
.paths.[].[]?.["responses"]? += {"5XX":{"description":"Failure response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleApiException"}}}}} | | ||
. * load("error.yaml") | ||
' $1 |