2017-10-12 00:01:37 +03:00
|
|
|
import * as React from 'react';
|
|
|
|
import { render } from 'react-dom';
|
2021-06-09 14:57:36 +03:00
|
|
|
import type { RedocRawOptions } from '../../src/services/RedocNormalizedOptions';
|
|
|
|
import RedocStandalone from './hot';
|
2017-10-12 00:01:37 +03:00
|
|
|
|
|
|
|
const big = window.location.search.indexOf('big') > -1;
|
2019-03-28 11:39:41 +03:00
|
|
|
const swagger = window.location.search.indexOf('swagger') > -1;
|
2017-10-12 00:01:37 +03:00
|
|
|
|
2019-03-28 11:39:41 +03:00
|
|
|
const userUrl = window.location.search.match(/url=(.*)$/);
|
|
|
|
|
|
|
|
const specUrl =
|
2024-04-02 18:16:44 +03:00
|
|
|
(userUrl && userUrl[1]) || (swagger ? 'museum.yaml' : big ? 'big-openapi.json' : 'museum.yaml');
|
2017-11-14 18:46:50 +03:00
|
|
|
|
2020-07-24 10:15:36 +03:00
|
|
|
const options: RedocRawOptions = { nativeScrollbars: false, maxDisplayedEnumValues: 3 };
|
2017-11-14 18:46:50 +03:00
|
|
|
|
2021-06-09 14:57:36 +03:00
|
|
|
render(<RedocStandalone specUrl={specUrl} options={options} />, document.getElementById('example'));
|