Last active
September 14, 2021 19:59
-
-
Save alehed/e5eb44e14f0dcf38a430421e62f9aa12 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openapi: "3.0.0" | |
info: | |
version: 1.0.0 | |
title: The Star Wars API | |
servers: | |
- url: https://swapi.dev/api/ | |
paths: | |
/planets: | |
get: | |
tags: | |
- swapi | |
operationId: getPlanets | |
responses: | |
"200": | |
description: List of planets | |
content: | |
application/json: | |
schema: | |
$ref: "#/components/schemas/PlanetList" | |
/planets/{planetId}: | |
get: | |
tags: | |
- swapi | |
operationId: getPlanet | |
parameters: | |
- name: planetId | |
in: path | |
description: Planet ID | |
required: true | |
schema: | |
type: integer | |
responses: | |
"200": | |
description: Planet name | |
content: | |
application/json: | |
schema: | |
$ref: "#/components/schemas/Planet" | |
components: | |
schemas: | |
Planet: | |
type: string | |
description: Planet name | |
PlanetList: | |
type: array | |
description: List of planets | |
items: | |
$ref: "#/components/schemas/Planet" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment