0.1.4 • Published 2 years ago
react-openapi-admin v0.1.4
React OpenAPI Admin
This is an (ALPHA) admin tool for OpenAPI specifications
Instalation
yarn add react-openapi-admin
Usage
import React, { useContext, useEffect, useState } from 'react';
import Admin from 'react-openapi-admin';
const AdminView = () => {
const params = useParams();
const [api, setApi] = useState();
const apiURL = "your openAPI specification URL goes here"
const loadApi = async () => {
try {
const response = await fetch(apiURL);
if (response.ok) {
const jres = await response.json();
setApi(jres);
}
} catch (err) {
console.error(err);
}
};
useEffect(() => {
loadApi();
}, []);
return <>{!api ? "LOADING" : <Admin API={api} />}</>);
};
Development
Available Scripts
yarn build
: TBD
yarn start
: TBD
yarn docs
: TBD
0.1.4
2 years ago