diff --git a/src/components/Endpoint/Endpoint.tsx b/src/components/Endpoint/Endpoint.tsx index 00d7bda0..bc7863d4 100644 --- a/src/components/Endpoint/Endpoint.tsx +++ b/src/components/Endpoint/Endpoint.tsx @@ -5,7 +5,7 @@ import { Markdown } from '../Markdown/Markdown'; import { OptionsContext } from '../OptionsProvider'; import { SelectOnClick } from '../SelectOnClick/SelectOnClick'; -import { getBasePath } from '../../utils'; +import {getBasePath, removeQueryString} from '../../utils'; import { EndpointInfo, HttpVerb, @@ -68,7 +68,7 @@ export class Endpoint extends React.Component { {hideHostname || options.hideHostname ? getBasePath(server.url) - : server.url} + : removeQueryString(server.url)} {operation.path} diff --git a/src/components/Fields/EnumValues.tsx b/src/components/Fields/EnumValues.tsx index ea3fe376..30472ff7 100644 --- a/src/components/Fields/EnumValues.tsx +++ b/src/components/Fields/EnumValues.tsx @@ -17,9 +17,11 @@ export class EnumValues extends React.PureComponent {
{type === 'array' ? 'Items' : ''} {values.length === 1 ? 'Value' : 'Enum'}: - + {' '} {values.map((value, idx) => ( - {JSON.stringify(value)} + + {JSON.stringify(value)} + ))}
); diff --git a/src/components/Fields/FieldDetail.tsx b/src/components/Fields/FieldDetail.tsx index 2aa792fb..26221439 100644 --- a/src/components/Fields/FieldDetail.tsx +++ b/src/components/Fields/FieldDetail.tsx @@ -14,7 +14,9 @@ export class FieldDetail extends React.PureComponent { return (
{this.props.label} {' '} - {JSON.stringify(this.props.value)} + + {JSON.stringify(this.props.value)} +
); } diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 92c955e3..de46f654 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -169,3 +169,9 @@ export function getBasePath(serverUrl: string): string { export function titleize(text: string) { return text.charAt(0).toUpperCase() + text.slice(1); } + +export function removeQueryString(serverUrl: string): string { + const url = new URL(serverUrl); + url.search = ''; + return url.toString(); +}