You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, importing the definition into my tool of choice (Paw) failed. It seems that if the schema fails validation, it drops it. Their developer recommended a pair of tools to check the openapi schema, both of which report errors with the current version of https://weather-gov.github.io/api/assets/openapi.yaml
Swagger schema validation failed.
Data does not match any schemas from 'oneOf' at #/components/schemas/CenterWeatherServiceUnitJsonLd
Expected type object but found type array at #/components/schemas/CenterWeatherServiceUnitJsonLd
Expected type object but found type array at #/components/schemas/CenterWeatherServiceUnitJsonLd
This one is a little misleading, it shows all the paths and components, and then way down at the bottom it has an "INVALID" badge with this:
{
"messages": [
"attribute components.schemas.CenterWeatherServiceUnitJsonLd is not of type `object`",
"attribute components.schemas.JsonLdContext.items is missing",
"attribute paths.'/aviation/cwsus/{cwsuId}'(get).responses.200.content.'application/ld+json'.schema.#/components/schemas/CenterWeatherServiceUnitJsonLd is missing"
],
"schemaValidationMessages": [
{
"level": "error",
"domain": "validation",
"keyword": "oneOf",
"message": "instance failed to match exactly one schema (matched 0 out of 2)",
"schema": {
"loadingURI": "#",
"pointer": "/definitions/Components/properties/schemas/patternProperties/^[a-zA-Z0-9\\.\\-_]+$"
},
"instance": {
"pointer": "/components/schemas/CenterWeatherServiceUnitJsonLd"
}
}
]
}
Fix?
I'm not 100% sure this is the correct fix, nor whether this is a hand-edited file or a machine-generated version (and if so, why the machine generated an invalid spec?), but I've worked around this for now by just removing the - on L2435 (since the validator said it wanted an object instead of an array)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I just started poking at the weather.gov API, and was very interested to see your API spec being published (re Full OpenAPI Definition for api.weather.gov).
However, importing the definition into my tool of choice (Paw) failed. It seems that if the schema fails validation, it drops it. Their developer recommended a pair of tools to check the openapi schema, both of which report errors with the current version of https://weather-gov.github.io/api/assets/openapi.yaml
https://apitools.dev/swagger-parser/online/
https://validator.swagger.io/
This one is a little misleading, it shows all the paths and components, and then way down at the bottom it has an "INVALID" badge with this:
Fix?
I'm not 100% sure this is the correct fix, nor whether this is a hand-edited file or a machine-generated version (and if so, why the machine generated an invalid spec?), but I've worked around this for now by just removing the
-
on L2435 (since the validator said it wanted an object instead of an array)api/assets/openapi.yaml
Lines 2434 to 2435 in 600cd09
Beta Was this translation helpful? Give feedback.
All reactions