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

https://github.com/thatbeautifuldream/react-api-ref

OpenAPI Docs Viewer
https://github.com/thatbeautifuldream/react-api-ref

api-docs openapi swagger

Last synced: 11 months ago
JSON representation

OpenAPI Docs Viewer

Awesome Lists containing this project

README

          

# OpenAPI Documentation Viewer

This is a simple React application that renders OpenAPI/Swagger documentation using [@scalar/api-reference-react](https://github.com/scalar/scalar). The app allows you to view any OpenAPI specification by providing its URL.

## Features

- View OpenAPI/Swagger documentation in a modern, interactive interface
- Default documentation loaded from Scalar's Galaxy API
- Persists your last viewed API specification URL in localStorage

## View custom docs by running this script on your console with your openapi spec url

```js
const specUrl = "https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.yaml"; // replace with your spec url
localStorage.setItem("specUrl", specUrl);
```

## Getting Started

### Prerequisites

- Node.js (v14 or higher)
- npm or yarn

### Installation

1. Clone this repository:

```bash
git clone
cd
```

2. Install dependencies:

```bash
npm install
# or
yarn
```

3. Start the development server:

```bash
npm run dev
# or
yarn dev
```

The application will be available at `http://localhost:5173` by default.

## Usage

The application will load the Scalar Galaxy API documentation by default. To view a different OpenAPI specification:

1. Have your OpenAPI specification hosted somewhere accessible via URL
2. Update the URL in the application
3. The application will remember your last viewed specification URL

## Built With

- [React](https://reactjs.org/)
- [TypeScript](https://www.typescriptlang.org/)
- [Vite](https://vitejs.dev/)
- [@scalar/api-reference-react](https://github.com/scalar/scalar) - For rendering OpenAPI documentation

## License

This project is licensed under the MIT License.