mirror of
https://github.com/Redocly/redoc.git
synced 2025-07-07 20:43:05 +03:00
fix: behaviour for downloadUrls and extend examples to description file
This commit is contained in:
parent
8ed46318c3
commit
a680dd716b
|
@ -309,6 +309,9 @@ components:
|
||||||
enum:
|
enum:
|
||||||
- event
|
- event
|
||||||
- general
|
- general
|
||||||
|
x-enumDescriptions:
|
||||||
|
event: Special event ticket
|
||||||
|
general: General museum entry ticket
|
||||||
example: event
|
example: event
|
||||||
Date:
|
Date:
|
||||||
type: string
|
type: string
|
||||||
|
@ -776,6 +779,9 @@ x-tagGroups:
|
||||||
- name: Purchases
|
- name: Purchases
|
||||||
tags:
|
tags:
|
||||||
- Tickets
|
- Tickets
|
||||||
|
- name: Entities
|
||||||
|
tags:
|
||||||
|
- schemas
|
||||||
|
|
||||||
security:
|
security:
|
||||||
- MuseumPlaceholderAuth: []
|
- MuseumPlaceholderAuth: []
|
||||||
|
|
|
@ -11,7 +11,11 @@ const userUrl = window.location.search.match(/url=(.*)$/);
|
||||||
const specUrl =
|
const specUrl =
|
||||||
(userUrl && userUrl[1]) || (swagger ? 'museum.yaml' : big ? 'big-openapi.json' : 'museum.yaml');
|
(userUrl && userUrl[1]) || (swagger ? 'museum.yaml' : big ? 'big-openapi.json' : 'museum.yaml');
|
||||||
|
|
||||||
const options: RedocRawOptions = { nativeScrollbars: false, maxDisplayedEnumValues: 3 };
|
const options: RedocRawOptions = {
|
||||||
|
nativeScrollbars: false,
|
||||||
|
maxDisplayedEnumValues: 3,
|
||||||
|
schemaDefinitionsTagName: 'schemas',
|
||||||
|
};
|
||||||
|
|
||||||
const container = document.getElementById('example');
|
const container = document.getElementById('example');
|
||||||
const root = createRoot(container!);
|
const root = createRoot(container!);
|
||||||
|
|
|
@ -88,7 +88,7 @@ export class ApiInfo extends React.Component<ApiInfoProps> {
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
key={url}
|
key={url}
|
||||||
>
|
>
|
||||||
{downloadUrls.length > 1 ? title : l('download')}
|
{title}
|
||||||
</DownloadButton>
|
</DownloadButton>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -46,7 +46,7 @@ export class ApiInfoModel implements OpenAPIInfo {
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
: this.options.downloadUrls.map(({ title, url }) => ({
|
: this.options.downloadUrls.map(({ title, url }) => ({
|
||||||
title: title || 'Download OpenAPI description',
|
title: title || l('download'),
|
||||||
url: this.getDownloadLink(url),
|
url: this.getDownloadLink(url),
|
||||||
}))
|
}))
|
||||||
).filter(({ title, url }) => title && url);
|
).filter(({ title, url }) => title && url);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user