This repo is a fork of stoplight elements. The plan for this repo is to update elements to allow us to rapidly deploy features we require and then look to merge back to elements. We have also added a vscode-extension package to this repository. This will allow developers to view elemental directly from vscode.
- Callbacks being rendered.
- Default try it out server and removal of server dropdown from try it out section.
- useCustomNav is optional and can be set to true to hide stoplights default sidebar.
- useGetOasNavTree parses an api spec and returns an array of grouped endpoints and schemas.
- hideInlineExamples is optional and can enable the global examples dropdown to drive all examples whilst disabling the inline example selects.
Instead of installing the stoplight component use:
$ npm install @jpmorganchase/elemental
Then follow stoplights readme at here
Make sure you've installed the above dependency and then change the code to:
import { API } from '@jpmorganchase/elemental';
<API
apiDescriptionUrl="https://api.apis.guru/v2/specs/github.com/1.1.4/openapi.yaml"
router="hash"
tryItOutDefaultServer="https://tryItOutServer.server.com/"
useCustomNav={true}
/>;
The try it out default server needs to be included in your api description document for this to work. If it is not found it will default to the first server in the spec.
We use Lerna to deploy. Follow these steps:
- Have all your code in main
- Create release branch from main like 'release/'
- Checkout your new branch locally
- Run 'yarn && yarn run version'
- Commit & push your changes
- Check the github actions 'Publish Package to npmjs' runs successfully
- PR your version upgrade back to main