Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devjack/example-library-specification
Using OpenAPI and JSON Schema to build a design-first API
https://github.com/devjack/example-library-specification
api json jsonschema openapi openapi-spec openapi-specification openapi3 rest-api restful-api speccy
Last synced: about 1 month ago
JSON representation
Using OpenAPI and JSON Schema to build a design-first API
- Host: GitHub
- URL: https://github.com/devjack/example-library-specification
- Owner: devjack
- Created: 2018-10-07T11:41:30.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-07T13:20:16.000Z (about 6 years ago)
- Last Synced: 2024-10-02T07:42:15.732Z (about 2 months ago)
- Topics: api, json, jsonschema, openapi, openapi-spec, openapi-specification, openapi3, rest-api, restful-api, speccy
- Language: HTML
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Example Library Specification
This repository defines a simple API using [OpenAPI v3.0.1](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md).[![Build Status](https://travis-ci.org/devjack/example-library-specification.svg?branch=master)](https://travis-ci.org/devjack/example-library-specification)
# Setup and installation
The API spec is defined in `openapi.yml`. Each URL has its own endpoint in `endpoints/` and JSON request/response schemas are defined in `schemas/`. JSON Schema is used to define responses and can be used for validation.
## Setup and run the documentation
Run these commands to install npm dependencies and serve the API documentation locally.```sh
npm install
npm run test
npm run serve
```The API documentation will be available at [https://localhost:5000](http://localhost:5000).
To resolve and publish the API spec, run:
```sh
npm run resolve
```A simple HTML document including [ReDoc](https://github.com/Rebilly/ReDoc) is available in the `public/` directory. To copy across the published spec and schemas, run:
```sh
npm run publish
```You can then serve `/public` from any static content hosting service. The current documentation is hosted on Netlify at [example-library-specification.netlify.com](https://example-library-specification.netlify.com)