Open API Playground
January 20, 2024 ยท View on GitHub
A sample showing OpenAPI description, Swagger_dart_code_generator, Prettier formatter, and Spectral linter.
Weather API of VisualCrossing was used for the example's sake. Free Key for the used Weather API can be obtained at https://www.visualcrossing.com/account after registration.
OpenAPI description (OAD) for the Weather API was found here: https://api.apis.guru/v2/specs/visualcrossing.com/weather/4.6/openapi.yaml
The weather OAD turns out to be of bad quality and lacking much data (which is good for the linter's example), more info about the types can be found on their website.
After installing Spectral linter, the validation can be run by:
spectral lint openapi_definitions/visualcrossing_weather_api.yaml --ruleset openapi_ruleset.spectral.yaml