mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 14:14:56 +03:00
Merge branch 'master' into fix-api-key-in-titleization
This commit is contained in:
commit
f424843e58
|
@ -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<EndpointProps, EndpointState> {
|
|||
<span>
|
||||
{hideHostname || options.hideHostname
|
||||
? getBasePath(server.url)
|
||||
: server.url}
|
||||
: removeQueryString(server.url)}
|
||||
</span>
|
||||
{operation.path}
|
||||
</ServerUrl>
|
||||
|
|
|
@ -17,9 +17,11 @@ export class EnumValues extends React.PureComponent<EnumValuesProps> {
|
|||
<div>
|
||||
<FieldLabel>
|
||||
{type === 'array' ? 'Items' : ''} {values.length === 1 ? 'Value' : 'Enum'}:
|
||||
</FieldLabel>
|
||||
</FieldLabel>{' '}
|
||||
{values.map((value, idx) => (
|
||||
<ExampleValue key={idx}>{JSON.stringify(value)} </ExampleValue>
|
||||
<ExampleValue key={idx}>
|
||||
{JSON.stringify(value)}
|
||||
</ExampleValue>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -14,7 +14,9 @@ export class FieldDetail extends React.PureComponent<FieldDetailProps> {
|
|||
return (
|
||||
<div>
|
||||
<FieldLabel> {this.props.label} </FieldLabel>{' '}
|
||||
<ExampleValue> {JSON.stringify(this.props.value)} </ExampleValue>
|
||||
<ExampleValue>
|
||||
{JSON.stringify(this.props.value)}
|
||||
</ExampleValue>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user