Advertisement
Guest User

Untitled

a guest
May 23rd, 2021
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.36 KB | None | 0 0
  1. openapi: "3.0.0"
  2. info:
  3.   version: 1.1.0
  4.   title: Cosmos
  5.   description: A sample API that retrieves constellations as an example to demonstrate features in the OpenAPI 3.0 specification
  6.   license:
  7.     name: MIT
  8. servers:
  9.   - url: https://2a6e0231-05f5-4028-8571-cbce1dcfb5b5.mock.pstmn.io
  10. paths:
  11.   /cosmos:
  12.     get:
  13.       description: Returns all constellations in this sample dataset
  14.       summary: List all cosmos
  15.       operationId: listCosmos
  16.       tags:
  17.        - cosmos
  18.       responses:
  19.         "200":
  20.           description: An object of constellations
  21.           content:
  22.             application/json:
  23.               schema:
  24.                 $ref: "#/components/schemas/Cosmos"
  25.         default:
  26.           description: unexpected error
  27.           content:
  28.             application/json:
  29.               schema:
  30.                 $ref: "#/components/schemas/Error"
  31.   /cosmos/{cosmoId}:
  32.     get:
  33.       description: Returns a constellation based on a single ID
  34.       summary: Info for a specific constellation
  35.       operationId: showCosmoById
  36.       tags:
  37.        - cosmos
  38.       parameters:
  39.         - name: cosmoId
  40.           in: path
  41.           required: true
  42.           description: The id of the constellation to retrieve
  43.           schema:
  44.             type: string
  45.       responses:
  46.         "200":
  47.           description: Expected response to a valid request
  48.           content:
  49.             application/json:
  50.               schema:
  51.                 $ref: "#/components/schemas/Cosmo"
  52.         default:
  53.           description: unexpected error
  54.           content:
  55.             application/json:
  56.               schema:
  57.                 $ref: "#/components/schemas/Error"
  58. components:
  59.   schemas:
  60.     Cosmos:
  61.       type: object
  62.       required:
  63.        - id
  64.         - name
  65.       properties:
  66.         id:
  67.           type: string
  68.           format: int64
  69.         name:
  70.           type: string
  71.         tag:
  72.           type: string
  73.     Cosmo:
  74.       type: object
  75.       properties:
  76.         id:
  77.           type: string
  78.           format: int64
  79.         name:
  80.           type: string
  81.         tag:
  82.           type: string
  83.         description:
  84.           type: string
  85.     Error:
  86.       type: object
  87.       required:
  88.        - code
  89.         - message
  90.       properties:
  91.         code:
  92.           type: integer
  93.           format: int32
  94.         message:
  95.           type: string
  96.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement