0.2.14 • Published 9 months ago

@scalar/galaxy v0.2.14

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Scalar Galaxy OpenAPI Example

Version Downloads License Discord

An OpenAPI example specification in YAML and JSON to test OpenAPI tooling, run test suites or learn about OpenAPI.

Installation

npm install @scalar/galaxy

Usage

CDN

VersionFormatURL
LatestJSONhttps://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.json
LatestYAMLhttps://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.yaml
OpenAPI 3.1JSONhttps://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/3.1.json
OpenAPI 3.1YAMLhttps://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/3.1.yaml

Import as object

import galaxy from '@scalar/galaxy/latest.json'

Import as JSON string

import galaxy from '@scalar/galaxy/latest.json?raw'

Import as YAML string

import galaxy from '@scalar/galaxy/latest.yaml?raw'

Import specific OpenAPI version

import galaxy from '@scalar/galaxy/3.1.json'

Development

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": "marc@scalar.com"
      }
    }
  ],
  "meta": {
    "limit": 10,
    "offset": 0,
    "total": 100,
    "next": "/planets?limit=10&offset=10"
  }
}

Serve an OpenAPI specification yaml using the CLI

npx @scalar/cli serve ./src/specifications/3.1.yaml --watch

Community

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.

0.2.14

9 months ago

0.2.13

9 months ago

0.2.12

9 months ago

0.2.11

9 months ago

0.2.10

9 months ago

0.2.9

10 months ago

0.2.8

10 months ago

0.2.1

1 year ago

0.2.0

1 year ago

0.2.7

11 months ago

0.2.6

11 months ago

0.2.3

1 year ago

0.1.4

1 year ago

0.2.2

1 year ago

0.2.5

12 months ago

0.2.4

1 year ago

0.1.5

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.0

1 year ago