Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/badsyntax/gatsby-openapi

A mono-repo with a set a gatsby plugins that can be used to build API docs from an OpenAPI specification.
https://github.com/badsyntax/gatsby-openapi

gatsby openapi

Last synced: 25 days ago
JSON representation

A mono-repo with a set a gatsby plugins that can be used to build API docs from an OpenAPI specification.

Awesome Lists containing this project

README

        

# gatsby-openapi

![Build and Deploy](https://github.com/badsyntax/gatsby-openapi/workflows/Build%20and%20Deploy/badge.svg)

A mono-repo with a set a gatsby plugins that can be used to build API docs from an OpenAPI specification.

__NOTE:__ This repo is in the very early stages of development.

## Plugins

- [gatsby-source-openapi](./packages/gatsby-source-openapi): Parse an OpenAPI 3 specification and create the gatsby graphql nodes.
- [gatsby-theme-openapi-core](./packages/gatsby-theme-openapi-core): Creates the theme pages.
- [gatsby-theme-openapi-theme-ui](./packages/gatsby-theme-openapi-theme-ui): Renders the OpenAPI docs using `theme-ui`.

## Examples

- [example-theme-ui](./packages.example-theme-ui): An example site using the [gatsby-theme-openapi-theme-ui]('./packages/gatsby-theme-openapi-theme-ui) theme

## Goals

- Provide a framework for building API docs with full customisation capabilities (not just tweaking theme variables)
- Provide some good default themes
- Provide features to render in a single page, or multiple pages
- Provide a CLI utility to easily bootstrap/scaffold

## Developing

This is a lerna project. Common dependencies are hoisted into the root `node_modules` directory. This means you must re-bootstrap the project (`npm run boostrap`) after installing any dependencies into any of the packages.

### Getting Started

```sh
# install lerna dependencies
npm install

# install & hoist package dependencies (this can take a long time)
npm run bootstrap

# run the example site
npm start
```

### Build the example site

```sh
npm run build
```

### Troubleshooting

`Error sourcing OpenAPI data: security.map(...).flat is not a function`

This usually means you're using an older version of node. Use the version as specified in `.nvmrc` or within `package.json`.

## License

MIT License

Copyright (c) 2020 Richard Willis