mirror of
https://github.com/Redocly/redoc.git
synced 2025-04-19 16:22: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:
|
||||
- event
|
||||
- general
|
||||
x-enumDescriptions:
|
||||
event: Special event ticket
|
||||
general: General museum entry ticket
|
||||
example: event
|
||||
Date:
|
||||
type: string
|
||||
|
@ -776,6 +779,9 @@ x-tagGroups:
|
|||
- name: Purchases
|
||||
tags:
|
||||
- Tickets
|
||||
- name: Entities
|
||||
tags:
|
||||
- schemas
|
||||
|
||||
security:
|
||||
- MuseumPlaceholderAuth: []
|
||||
|
|
|
@ -11,7 +11,11 @@ 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 };
|
||||
const options: RedocRawOptions = {
|
||||
nativeScrollbars: false,
|
||||
maxDisplayedEnumValues: 3,
|
||||
schemaDefinitionsTagName: 'schemas',
|
||||
};
|
||||
|
||||
const container = document.getElementById('example');
|
||||
const root = createRoot(container!);
|
||||
|
|
|
@ -88,7 +88,7 @@ export class ApiInfo extends React.Component<ApiInfoProps> {
|
|||
rel="noreferrer"
|
||||
key={url}
|
||||
>
|
||||
{downloadUrls.length > 1 ? title : l('download')}
|
||||
{title}
|
||||
</DownloadButton>
|
||||
);
|
||||
})}
|
||||
|
|
|
@ -46,7 +46,7 @@ export class ApiInfoModel implements OpenAPIInfo {
|
|||
},
|
||||
]
|
||||
: this.options.downloadUrls.map(({ title, url }) => ({
|
||||
title: title || 'Download OpenAPI description',
|
||||
title: title || l('download'),
|
||||
url: this.getDownloadLink(url),
|
||||
}))
|
||||
).filter(({ title, url }) => title && url);
|
||||
|
|
Loading…
Reference in New Issue
Block a user