An OpenAPI example specification in YAML and JSON to test OpenAPI tooling, run test suites or learn about OpenAPI.
npm install @scalar/galaxy
Version | Format | URL |
---|---|---|
Latest | JSON | https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.json |
Latest | YAML | https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.yaml |
OpenAPI 3.1 | JSON | https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/3.1.json |
OpenAPI 3.1 | YAML | https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/3.1.yaml |
import galaxy from '@scalar/galaxy/latest.json'
import galaxy from '@scalar/galaxy/latest.json?raw'
import galaxy from '@scalar/galaxy/latest.yaml?raw'
import galaxy from '@scalar/galaxy/3.1.json'
Use the @scalar/mock-server
to serve an OpenAPI document:
npm run dev
Explore the API by making requests to it using your favourite API exploration tools:
curl http://localhost:5052/planets
Response
{
"data": [
{
"id": 1,
"name": "Mars",
"description": "The red planet",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"creator": {
"id": 1,
"name": "Marc",
"email": "[email protected]"
}
}
],
"meta": {
"limit": 10,
"offset": 0,
"total": 100,
"next": "/planets?limit=10&offset=10"
}
}
npx @scalar/cli serve ./src/specifications/3.1.yaml --watch
We are API nerds. You too? Let’s chat on Discord: https://discord.gg/scalar
The source code in this repository is licensed under MIT.