Détail du package

@scalar/galaxy

scalar2kMIT0.5.1

OpenAPI example specification in YAML and JSON

openapi, example, swagger, petstore

readme

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

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 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 document using the CLI

npx @scalar/cli document serve ./src/documents/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.

changelog

@scalar/galaxy

0.5.1

Patch Changes

  • b1ea8f0: feat: adds celestial bodies post operation to galaxy

0.5.0

Minor Changes

  • edf694b: refactor!: use openapi-parser utils, remove the deprecated pipeline syntax

Patch Changes

  • 442c0a3: feat: added support for callbacks

0.4.1

Patch Changes

  • 4440949: chore: bumping packages

0.4.0

Minor Changes

  • 483ca93: chore: require Node 20 (or above)

0.3.2

Patch Changes

  • 8c7bad8: chore: move build tooling to esbuild

0.3.1

Patch Changes

  • 560be28: feat(api-reference): add copy button to examples and redesign them

0.3.0

Minor Changes

  • 9eb5c6b: feat: more data for planets

Patch Changes

  • 9eb5c6b: fix: examples for images are invalid
  • 9eb5c6b: fix: some responses are missing

0.2.24

Patch Changes

  • bab7990: refactor: move HtmlRenderingConfiguration type to types package

0.2.23

Patch Changes

  • 202e405: fix: add types package to galaxy docker file
  • 989ad08: fix: include all packages in dockerfile

0.2.22

Patch Changes

  • fd8d71a: fix: make galaxy playground private so it does not publish

0.2.21

Patch Changes

  • 298b6f6: fix: import api reference package in dockerfile

0.2.20

Patch Changes

  • 54fdfcb: chore: remove spec wording
  • fa6afe8: chore: code formatting
  • 1223c1f: chore: code style

0.2.19

Patch Changes

  • f500435: chore: stricter TypeScript configuration
  • fac2800: feat: error responses
  • fac2800: feat: use package version as version
  • 31f93d7: feat: add xml support
  • fac2800: feat: file upload examples

0.2.18

Patch Changes

  • 702c386: feat: mark deletePlanet as experimental

0.2.17

Patch Changes

  • 0462003: feat: add readOnly/writeOnly attributes

0.2.16

Patch Changes

  • a607115: feat: add openapi 3.0.4 and openapi 3.1.1

0.2.15

Patch Changes

  • b28c70f: feat: add an openIdConnect security scheme

0.2.14

Patch Changes

  • ca8c8d0: feat(galaxy): load the spec from a URL rather than as content

0.2.13

Patch Changes

  • 4cf8c52: feat: add OAuth code flow

0.2.12

Patch Changes

  • 4e50d65: feat: added live updating spec

0.2.11

Patch Changes

  • dbbe38f: feat: add framework identifier for debugging purposes

0.2.10

Patch Changes

  • e911047: Add default exports

0.2.9

Patch Changes

  • aee166c: feat: add variables to the second server
  • 040ca78: feat: add oauth code authorization

0.2.8

Patch Changes

  • e4b326e: feat(galaxy): add multiple examples to request body and schema
  • e4b326e: feat: add multiple examples to some schemas

0.2.7

Patch Changes

  • 7a6783e: feat(galaxy): migrate galaxy to monorepo

0.2.6

Patch Changes

  • 7f21330: fix: improper usage of ref in token response

0.2.5

Patch Changes

  • 05c1360: fix(api-reference): allow scrolling to collapsed sections via hash

0.2.4

Patch Changes

  • 94e68ab: chore: upgrade typescript to 5.5

0.2.3

Patch Changes

  • 18bfa05: feat: add void.scalar.com as an alternative server

0.2.2

Patch Changes

  • c185f10: chore: use Node script to format specifications

0.2.1

Patch Changes

  • e0fc110: chore: patch bump all package
  • f0acc89: chore: upgrade to new @scalar/openapi-parser version

0.2.0

Minor Changes

  • 7f8ef74: chore: remove aliasing

Patch Changes

  • b38c7ed: Update build configs to a standardized format
  • 6fbb57e: feat: release all the packages

0.1.5

Patch Changes

  • c8066f3: chore: remove headings from inside the details tag

0.1.4

Patch Changes

  • 30953fa: Add scalar galaxy yaml export and improve React reference reactivity

0.1.3

Patch Changes

  • 165b901: feat: dynamic values for generated examples

0.1.2

Patch Changes

  • 45dc04b: fix: can’t release packages

0.1.1

Patch Changes

  • 05e2e27: chore: add provenance statement

0.1.0

Minor Changes

  • 53ba90d: hello world :)