mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 08:36:33 +03:00
3f3f9551ee
* feat: Update API examples list to include Museum API * updates museum.yaml with logo and replaces petstore with museum api in playground for local dev and some minor edits to redoc name * docs: update definition --------- Co-authored-by: Heather Cloward <heathercloward@gmail.com> Co-authored-by: Alex Varchuk <olexandr.varchuk@gmail.com>
17 lines
676 B
TypeScript
17 lines
676 B
TypeScript
import * as React from 'react';
|
|
import { render } from 'react-dom';
|
|
import type { RedocRawOptions } from '../../src/services/RedocNormalizedOptions';
|
|
import RedocStandalone from './hot';
|
|
|
|
const big = window.location.search.indexOf('big') > -1;
|
|
const swagger = window.location.search.indexOf('swagger') > -1;
|
|
|
|
const userUrl = window.location.search.match(/url=(.*)$/);
|
|
|
|
const specUrl =
|
|
(userUrl && userUrl[1]) || (swagger ? 'museum.yaml' : big ? 'big-openapi.json' : 'museum.yaml');
|
|
|
|
const options: RedocRawOptions = { nativeScrollbars: false, maxDisplayedEnumValues: 3 };
|
|
|
|
render(<RedocStandalone specUrl={specUrl} options={options} />, document.getElementById('example'));
|