Skip to content
v1.0.0

Scalar Galaxy

The Scalar Galaxy is an example OpenAPI specification to test OpenAPI tools and libraries. It’s a fictional universe with fictional planets and fictional data. Get all the data for all planets.

Resources

  • https://github.com/scalar/scalar
  • https://github.com/OAI/OpenAPI-Specification
  • https://scalar.com

Markdown Support

All descriptions can contain tons of text Markdown. If GitHub supports the syntax, chances are we’re supporting it, too. You can even create internal links to reference endpoints.

Examples

Blockquotes

I love OpenAPI. <3

Tables

Feature Availability
Markdown Support

Accordion

<details>
  <summary>Using Details Tags</summary>
  <p>HTML Example</p>
</details>

Images

Yes, there’s support for images, too!

Empty placeholder image showing the width/height

Contact

License

MIT

Servers

https://galaxy.scalar.com
{protocol}://void.scalar.com/{path}Responds with your request data

ID: getAllData

Get all planets

GET
/planets
Server

It’s easy to say you know them all, but do you really? Retrieve all the planets and check whether you missed one.

Parameters

Query Parameters

limit

The number of items to return

Typeinteger
formatint64
default10
offset

The number of items to skip before starting to collect the result set

Typeinteger
formatint64
default0

Responses

OK
JSON
{
"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",
"password": "i-love-scalar"
}
}
],
"meta": {
"limit": 10,
"offset": 0,
"total": 100,
"next": "/planets?limit=10&offset=10"
}
}

Samples


ID: createPlanet

Create a planet

POST
/planets
Server

Time to play god and create a new planet. What do you think? Ah, don’t think too much. What could go wrong anyway?

Authorizations

bearerAuth

JWT Bearer token authentication

TypeHTTP (bearer)
or
basicAuth

Basic HTTP authentication

TypeHTTP (basic)
or
apiKeyQuery

API key query parameter

TypeAPI Key (query: api_key)
or
apiKeyHeader

API key request header

TypeAPI Key (header: X-API-Key)
or
apiKeyCookie

API key browser cookie

TypeAPI Key (cookie: api_key)
or
oAuth2

OAuth 2.0 authentication

authorizationCode Flow
Authorization URLhttps://galaxy.scalar.com/oauth/authorize
Token URLhttps://galaxy.scalar.com/oauth/token
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
clientCredentials Flow
Token URLhttps://galaxy.scalar.com/oauth/token
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
implicit Flow
Authorization URLhttps://galaxy.scalar.com/oauth/authorize
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
password Flow
Token URLhttps://galaxy.scalar.com/oauth/token
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
or
openIdConnect

OpenID Connect Authentication

TypeOpenID Connect (https://galaxy.scalar.com/.well-known/openid-configuration)

Request Body

JSON
{
"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",
"password": "i-love-scalar"
}
}

Responses

Created
JSON
{
"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",
"password": "i-love-scalar"
}
}

Samples


ID: getPlanet

Get a planet

GET
/planets/{planetId}
Server

You’ll better learn a little bit more about the planets. It might come in handy once space travel is available for everyone.

Parameters

Path Parameters

planetId*

The ID of the planet to get

Typeinteger
Required
Example1
formatint64

Responses

Planet Found
JSON
{
"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",
"password": "i-love-scalar"
}
}

Samples


ID: updatePlanet

Update a planet

PUT
/planets/{planetId}
Server

Sometimes you make mistakes, that’s fine. No worries, you can update all planets.

Authorizations

bearerAuth

JWT Bearer token authentication

TypeHTTP (bearer)
or
basicAuth

Basic HTTP authentication

TypeHTTP (basic)
or
apiKeyQuery

API key query parameter

TypeAPI Key (query: api_key)
or
apiKeyHeader

API key request header

TypeAPI Key (header: X-API-Key)
or
apiKeyCookie

API key browser cookie

TypeAPI Key (cookie: api_key)
or
oAuth2

OAuth 2.0 authentication

authorizationCode Flow
Authorization URLhttps://galaxy.scalar.com/oauth/authorize
Token URLhttps://galaxy.scalar.com/oauth/token
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
clientCredentials Flow
Token URLhttps://galaxy.scalar.com/oauth/token
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
implicit Flow
Authorization URLhttps://galaxy.scalar.com/oauth/authorize
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
password Flow
Token URLhttps://galaxy.scalar.com/oauth/token
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
or
openIdConnect

OpenID Connect Authentication

TypeOpenID Connect (https://galaxy.scalar.com/.well-known/openid-configuration)

Parameters

Path Parameters

planetId*

The ID of the planet to get

Typeinteger
Required
Example1
formatint64

Request Body

JSON
{
"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",
"password": "i-love-scalar"
}
}

Responses

OK
JSON
{
"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",
"password": "i-love-scalar"
}
}

Samples


ID: deletePlanet

Delete a planet

DELETE
/planets/{planetId}
Server

This endpoint was used to delete planets. Unfortunately, that caused a lot of trouble for planets with life. So, this endpoint is now deprecated and should not be used anymore.

Authorizations

bearerAuth

JWT Bearer token authentication

TypeHTTP (bearer)
or
basicAuth

Basic HTTP authentication

TypeHTTP (basic)
or
apiKeyQuery

API key query parameter

TypeAPI Key (query: api_key)
or
apiKeyHeader

API key request header

TypeAPI Key (header: X-API-Key)
or
apiKeyCookie

API key browser cookie

TypeAPI Key (cookie: api_key)
or
oAuth2

OAuth 2.0 authentication

authorizationCode Flow
Authorization URLhttps://galaxy.scalar.com/oauth/authorize
Token URLhttps://galaxy.scalar.com/oauth/token
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
clientCredentials Flow
Token URLhttps://galaxy.scalar.com/oauth/token
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
implicit Flow
Authorization URLhttps://galaxy.scalar.com/oauth/authorize
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
password Flow
Token URLhttps://galaxy.scalar.com/oauth/token
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
or
openIdConnect

OpenID Connect Authentication

TypeOpenID Connect (https://galaxy.scalar.com/.well-known/openid-configuration)

Parameters

Path Parameters

planetId*

The ID of the planet to get

Typeinteger
Required
Example1
formatint64

Responses

No Content

Samples


ID: uploadImage

Upload an image to a planet

POST
/planets/{planetId}/image
Server

Got a crazy good photo of a planet? Share it with the world!

Authorizations

bearerAuth

JWT Bearer token authentication

TypeHTTP (bearer)
or
basicAuth

Basic HTTP authentication

TypeHTTP (basic)
or
apiKeyQuery

API key query parameter

TypeAPI Key (query: api_key)
or
apiKeyHeader

API key request header

TypeAPI Key (header: X-API-Key)
or
apiKeyCookie

API key browser cookie

TypeAPI Key (cookie: api_key)
or
oAuth2

OAuth 2.0 authentication

authorizationCode Flow
Authorization URLhttps://galaxy.scalar.com/oauth/authorize
Token URLhttps://galaxy.scalar.com/oauth/token
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
clientCredentials Flow
Token URLhttps://galaxy.scalar.com/oauth/token
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
implicit Flow
Authorization URLhttps://galaxy.scalar.com/oauth/authorize
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
password Flow
Token URLhttps://galaxy.scalar.com/oauth/token
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
or
openIdConnect

OpenID Connect Authentication

TypeOpenID Connect (https://galaxy.scalar.com/.well-known/openid-configuration)

Parameters

Path Parameters

planetId*

The ID of the planet to get

Typeinteger
Required
Example1
formatint64

Request Body

JSON
{
"image": "string"
}

Responses

Image uploaded
JSON
{
"message": "Image uploaded successfully",
"imageUrl": "https://cdn.scalar.com/images/8f47c132-9d1f-4f83-b5a4-91db5ee757ab.jpg",
"uploadedAt": {
},
"fileSize": 1048576,
"mimeType": "image/jpeg"
}

Samples


Authentication

Some endpoints are public, but some require authentication. We provide all the required endpoints to create an account and authorize yourself.


ID: createUser

Create a user

POST
/user/signup
Server

Time to create a user account, eh?

Request Body

JSON
{
"name": "Marc",
"email": "marc@scalar.com",
"password": "i-love-scalar"
}

Responses

Created
JSON
{
"id": 1,
"name": "Marc",
"email": "marc@scalar.com",
"password": "i-love-scalar"
}

Samples


ID: getToken

Get a token

POST
/auth/token
Server

Yeah, this is the boring security stuff. Just get your super secret token and move on.

Request Body

JSON
{
"email": "marc@scalar.com",
"password": "i-love-scalar"
}

Responses

Token Created
JSON
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}

Samples


ID: getMe

Get authenticated user

GET
/me
Server

Find yourself they say. That’s what you can do here.

Authorizations

basicAuth

Basic HTTP authentication

TypeHTTP (basic)
or
oAuth2

OAuth 2.0 authentication

authorizationCode Flow
Authorization URLhttps://galaxy.scalar.com/oauth/authorize
Token URLhttps://galaxy.scalar.com/oauth/token
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
clientCredentials Flow
Token URLhttps://galaxy.scalar.com/oauth/token
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
implicit Flow
Authorization URLhttps://galaxy.scalar.com/oauth/authorize
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
password Flow
Token URLhttps://galaxy.scalar.com/oauth/token
Scopes:
  • read:accountread your account information
  • write:planetsmodify planets in your account
  • read:planetsread your planets
or
bearerAuth

JWT Bearer token authentication

TypeHTTP (bearer)
or
apiKeyHeader

API key request header

TypeAPI Key (header: X-API-Key)
or
apiKeyQuery

API key query parameter

TypeAPI Key (query: api_key)

Responses

OK
JSON
{
"id": 1,
"name": "Marc",
"email": "marc@scalar.com",
"password": "i-love-scalar"
}

Samples


Powered by VitePress OpenAPI