Redocly / museum-openapi-example

An example OpenAPI description for an imaginary Museum API.
https://redocly.com/docs/resources/learning-openapi/
MIT License
40 stars 36 forks source link
apis example oas-description openapi openapi-description openapi-example openapi-sp openapi-spec openapi3 rest

Redocly Museum API Example

An imaginary, but delightful Museum API for interacting with museum services and information. Built by Redocly for educational purposes.

[!NOTE]
This OpenAPI description uses the OpenAPI 3.1.0 specification.

Overview

Introducing the "Museum API", which offers a set of endpoints to interact with a museum's services--such as retrieving museum hours, managing special events, and purchasing tickets.

New functionality may be added to the Museum API in the future. Is there an example you'd like to see? Please open an issue.

Features

[!NOTE]
Reminder that these are fictional examples for learning purposes. The contents of this repository are illustrations to use with your OpenAPI study or tools exploration.

OpenAPI

The Museum API has the following core features (sorted by tags):

Arazzo

Getting started

  1. Clone this repo.
  2. Open the repo in your IDE.
  3. Run npm install to install the Redocly CLI.

Working with the OpenAPI description

We encourage you to explore the museum's OpenAPI description and make changes. Try experimenting with the following approaches:

Preview the Museum OpenAPI example's API docs and observe your changes visually.

    description: |-
        Return a list of _upcoming_ special events at the museum.

        See one you like? Use this API to [buy a ticket](/#tag/Tickets/operation/buyMuseumTickets).  

See the updated description? This is a great way to preview how end-users of your docs will experience your changes.

Lint your changes to the OpenAPI description using Redocly CLI.

  /example:
    get: 
      summary: Example Summary
      description: Example description
      responses: 
        '200':
          description: Success
        '400': 
          description: Bad Request

The linting behavior is controlled by the redocly.yaml configuration file. The linter is configured to use Redocly's recommended ruleset, which are built into the CLI. However, we also added a configurable rule for enforcing sentence casing on operation summaries.

Lint an Arazzo description using Redocly CLI.