@scalar/galaxy v0.5.0
Scalar Galaxy OpenAPI Example
An OpenAPI example specification in YAML and JSON to test OpenAPI tooling, run test suites or learn about OpenAPI.
Installation
npm install @scalar/galaxyUsage
CDN
| 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 as object
import ScalarGalaxy from '@scalar/galaxy/latest.json'Import as JSON string
import ScalarGalaxy from '@scalar/galaxy/latest.json?raw'Import as YAML string
import ScalarGalaxy from '@scalar/galaxy/latest.yaml?raw'Import specific OpenAPI version
import ScalarGalaxy from '@scalar/galaxy/3.1.json'Development
Use the @scalar/mock-server to serve an OpenAPI document:
npm run devExplore the API by making requests to it using your favourite API exploration tools:
curl http://localhost:5052/planetsResponse
{
"data": [
{
"id": 1,
"name": "Mars",
"description": "The red planet",
"image": "https://cdn.scalar.com/photos/mars.jpg",
"creator": {
"id": 1,
"name": "Marc",
"email": "marc@scalar.com"
}
}
],
"meta": {
"limit": 10,
"offset": 0,
"total": 100,
"next": "/planets?limit=10&offset=10"
}
}Serve an OpenAPI document using the CLI
npx @scalar/cli document serve ./src/documents/3.1.yaml --watchCommunity
We are API nerds. You too? Let’s chat on Discord: https://discord.gg/scalar
License
The source code in this repository is licensed under MIT.
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
1 year ago
1 year ago
10 months ago
8 months ago
8 months ago
9 months ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago