mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-01 19:00:21 +03:00
Merge 6338fdc51c
into 3f3f9551ee
This commit is contained in:
commit
1a90682344
|
@ -66,6 +66,14 @@ If set to `true`, the pattern is not shown in the schema.
|
|||
|
||||
Hides the schema title next to to the type.
|
||||
|
||||
### hideObjectTitle
|
||||
|
||||
Hides the object title in the schema.
|
||||
|
||||
### hideObjectDescription
|
||||
|
||||
Hides the object description in the schema.
|
||||
|
||||
### hideSecuritySection
|
||||
|
||||
Hides the Security panel section.
|
||||
|
|
|
@ -104,7 +104,8 @@ export class Field extends React.Component<FieldProps> {
|
|||
schema={field.schema}
|
||||
skipReadOnly={this.props.skipReadOnly}
|
||||
skipWriteOnly={this.props.skipWriteOnly}
|
||||
showTitle={this.props.showTitle}
|
||||
hideObjectTitle={this.props.hideObjectTitle}
|
||||
hideObjectDescription={this.props.hideObjectDescription}
|
||||
level={this.props.level}
|
||||
/>
|
||||
</InnerPropertiesWrap>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import * as React from 'react';
|
||||
import { DropdownOrLabel, DropdownOrLabelProps } from '../DropdownOrLabel/DropdownOrLabel';
|
||||
import { ParametersGroup } from './ParametersGroup';
|
||||
import { OptionsContext } from '../OptionsProvider';
|
||||
|
||||
import { UnderlinedHeader } from '../../common-elements';
|
||||
|
||||
|
@ -29,6 +30,8 @@ export interface ParametersProps {
|
|||
const PARAM_PLACES = ['path', 'query', 'cookie', 'header'];
|
||||
|
||||
export class Parameters extends React.PureComponent<ParametersProps> {
|
||||
static contextType = OptionsContext;
|
||||
|
||||
orderParams(params: FieldModel[]): Record<string, FieldModel[]> {
|
||||
const res = {};
|
||||
params.forEach(param => {
|
||||
|
@ -38,6 +41,7 @@ export class Parameters extends React.PureComponent<ParametersProps> {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { hideObjectTitle, hideObjectDescription } = this.context;
|
||||
const { body, parameters = [] } = this.props;
|
||||
if (body === undefined && parameters === undefined) {
|
||||
return null;
|
||||
|
@ -63,6 +67,8 @@ export class Parameters extends React.PureComponent<ParametersProps> {
|
|||
content={bodyContent}
|
||||
description={bodyDescription}
|
||||
bodyRequired={bodyRequired}
|
||||
hideObjectTitle={hideObjectTitle}
|
||||
hideObjectDescription={hideObjectDescription}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
|
@ -90,8 +96,10 @@ export function BodyContent(props: {
|
|||
content: MediaContentModel;
|
||||
description?: string;
|
||||
bodyRequired?: boolean;
|
||||
hideObjectTitle?: boolean;
|
||||
hideObjectDescription?: boolean;
|
||||
}): JSX.Element {
|
||||
const { content, description, bodyRequired } = props;
|
||||
const { content, description, bodyRequired, hideObjectTitle, hideObjectDescription } = props;
|
||||
const { isRequestType } = content;
|
||||
return (
|
||||
<MediaTypesSwitch
|
||||
|
@ -108,6 +116,8 @@ export function BodyContent(props: {
|
|||
<Schema
|
||||
skipReadOnly={isRequestType}
|
||||
skipWriteOnly={!isRequestType}
|
||||
hideObjectTitle={hideObjectTitle}
|
||||
hideObjectDescription={hideObjectDescription}
|
||||
key="schema"
|
||||
schema={schema}
|
||||
/>
|
||||
|
|
|
@ -11,9 +11,13 @@ import { Extensions } from '../Fields/Extensions';
|
|||
import { Markdown } from '../Markdown/Markdown';
|
||||
import { ResponseHeaders } from './ResponseHeaders';
|
||||
import { ConstraintsView } from '../Fields/FieldConstraints';
|
||||
import { OptionsContext } from '../OptionsProvider';
|
||||
|
||||
export class ResponseDetails extends React.PureComponent<{ response: ResponseModel }> {
|
||||
static contextType = OptionsContext;
|
||||
|
||||
render() {
|
||||
const { hideObjectTitle, hideObjectDescription } = this.context;
|
||||
const { description, extensions, headers, content } = this.props.response;
|
||||
return (
|
||||
<>
|
||||
|
@ -27,7 +31,13 @@ export class ResponseDetails extends React.PureComponent<{ response: ResponseMod
|
|||
{schema?.type === 'object' && (
|
||||
<ConstraintsView constraints={schema?.constraints || []} />
|
||||
)}
|
||||
<Schema skipWriteOnly={true} key="schema" schema={schema} />
|
||||
<Schema
|
||||
hideObjectTitle={hideObjectTitle}
|
||||
hideObjectDescription={hideObjectDescription}
|
||||
skipWriteOnly={true}
|
||||
key="schema"
|
||||
schema={schema}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}}
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
import { observer } from 'mobx-react';
|
||||
import * as React from 'react';
|
||||
|
||||
import styled from '../../styled-components';
|
||||
import { H3 } from '../../common-elements/headers';
|
||||
import { Markdown } from '../Markdown/Markdown';
|
||||
|
||||
import { SchemaModel } from '../../services/models';
|
||||
|
||||
import { PropertiesTable, PropertiesTableCaption } from '../../common-elements/fields-layout';
|
||||
import { PropertiesTable } from '../../common-elements/fields-layout';
|
||||
import { Field } from '../Fields/Field';
|
||||
import { DiscriminatorDropdown } from './DiscriminatorDropdown';
|
||||
import { SchemaProps } from './Schema';
|
||||
|
@ -18,13 +22,26 @@ export interface ObjectSchemaProps extends SchemaProps {
|
|||
};
|
||||
}
|
||||
|
||||
export const ObjectSchemaDetails = styled.div`
|
||||
margin: 0 0 0.5em 0;
|
||||
`;
|
||||
|
||||
export const ObjectSchemaTitle = styled(H3)`
|
||||
margin: 0.5em 0 0 0;
|
||||
`;
|
||||
|
||||
export const ObjectSchemaDescription = styled.div`
|
||||
margin: 0.5em 0 0 0;
|
||||
`;
|
||||
|
||||
export const ObjectSchema = observer(
|
||||
({
|
||||
schema: { fields = [], title },
|
||||
showTitle,
|
||||
schema: { fields = [], title, description },
|
||||
discriminator,
|
||||
skipReadOnly,
|
||||
skipWriteOnly,
|
||||
hideObjectTitle,
|
||||
hideObjectDescription,
|
||||
level,
|
||||
}: ObjectSchemaProps) => {
|
||||
const { expandSingleSchemaField, showObjectSchemaExamples, schemaExpansionLevel } =
|
||||
|
@ -48,37 +65,48 @@ export const ObjectSchema = observer(
|
|||
(expandSingleSchemaField && filteredFields.length === 1) || schemaExpansionLevel >= level!;
|
||||
|
||||
return (
|
||||
<PropertiesTable>
|
||||
{showTitle && <PropertiesTableCaption>{title}</PropertiesTableCaption>}
|
||||
<tbody>
|
||||
{mapWithLast(filteredFields, (field, isLast) => {
|
||||
return (
|
||||
<Field
|
||||
key={field.name}
|
||||
isLast={isLast}
|
||||
field={field}
|
||||
expandByDefault={expandByDefault}
|
||||
renderDiscriminatorSwitch={
|
||||
discriminator?.fieldName === field.name
|
||||
? () => (
|
||||
<DiscriminatorDropdown
|
||||
parent={discriminator!.parentSchema}
|
||||
enumValues={field.schema.enum}
|
||||
/>
|
||||
)
|
||||
: undefined
|
||||
}
|
||||
className={field.expanded ? 'expanded' : undefined}
|
||||
showExamples={showObjectSchemaExamples}
|
||||
skipReadOnly={skipReadOnly}
|
||||
skipWriteOnly={skipWriteOnly}
|
||||
showTitle={showTitle}
|
||||
level={level}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</PropertiesTable>
|
||||
<div>
|
||||
<ObjectSchemaDetails>
|
||||
{!hideObjectTitle && <ObjectSchemaTitle>{title}</ObjectSchemaTitle>}
|
||||
{!hideObjectDescription && (
|
||||
<ObjectSchemaDescription>
|
||||
<Markdown compact={true} source={description} />
|
||||
</ObjectSchemaDescription>
|
||||
)}
|
||||
</ObjectSchemaDetails>
|
||||
|
||||
<PropertiesTable>
|
||||
<tbody>
|
||||
{mapWithLast(filteredFields, (field, isLast) => {
|
||||
return (
|
||||
<Field
|
||||
key={field.name}
|
||||
isLast={isLast}
|
||||
field={field}
|
||||
expandByDefault={expandByDefault}
|
||||
renderDiscriminatorSwitch={
|
||||
discriminator?.fieldName === field.name
|
||||
? () => (
|
||||
<DiscriminatorDropdown
|
||||
parent={discriminator!.parentSchema}
|
||||
enumValues={field.schema.enum}
|
||||
/>
|
||||
)
|
||||
: undefined
|
||||
}
|
||||
className={field.expanded ? 'expanded' : undefined}
|
||||
showExamples={showObjectSchemaExamples}
|
||||
skipReadOnly={skipReadOnly}
|
||||
skipWriteOnly={skipWriteOnly}
|
||||
hideObjectTitle={hideObjectTitle}
|
||||
hideObjectDescription={hideObjectDescription}
|
||||
level={level}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</PropertiesTable>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
|
@ -13,9 +13,10 @@ import { RecursiveSchema } from './RecursiveSchema';
|
|||
import { isArray } from '../../utils/helpers';
|
||||
|
||||
export interface SchemaOptions {
|
||||
showTitle?: boolean;
|
||||
skipReadOnly?: boolean;
|
||||
skipWriteOnly?: boolean;
|
||||
hideObjectTitle?: boolean;
|
||||
hideObjectDescription?: boolean;
|
||||
level?: number;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@ export interface ObjectDescriptionProps {
|
|||
exampleRef?: string;
|
||||
showReadOnly?: boolean;
|
||||
showWriteOnly?: boolean;
|
||||
showObjectTitle?: boolean;
|
||||
showObjectDescription?: boolean;
|
||||
showExample?: boolean;
|
||||
parser: OpenAPIParser;
|
||||
options: RedocNormalizedOptions;
|
||||
|
@ -54,7 +56,13 @@ export class SchemaDefinition extends React.PureComponent<ObjectDescriptionProps
|
|||
}
|
||||
|
||||
render() {
|
||||
const { showReadOnly = true, showWriteOnly = false, showExample = true } = this.props;
|
||||
const {
|
||||
showReadOnly = true,
|
||||
showWriteOnly = false,
|
||||
showExample = true,
|
||||
showObjectTitle = false,
|
||||
showObjectDescription = false,
|
||||
} = this.props;
|
||||
return (
|
||||
<Section>
|
||||
<Row>
|
||||
|
@ -62,6 +70,8 @@ export class SchemaDefinition extends React.PureComponent<ObjectDescriptionProps
|
|||
<Schema
|
||||
skipWriteOnly={!showWriteOnly}
|
||||
skipReadOnly={!showReadOnly}
|
||||
hideObjectTitle={!showObjectTitle}
|
||||
hideObjectDescription={!showObjectDescription}
|
||||
schema={this.mediaModel.schema}
|
||||
/>
|
||||
</MiddlePanel>
|
||||
|
|
|
@ -2865,143 +2865,156 @@ exports[`Components SchemaView discriminator should correctly render SchemaView
|
|||
`;
|
||||
|
||||
exports[`Components SchemaView discriminator should correctly render discriminator dropdown 1`] = `
|
||||
<styled.table>
|
||||
<tbody>
|
||||
<Field
|
||||
expandByDefault={false}
|
||||
field={
|
||||
FieldModel {
|
||||
"const": "",
|
||||
"deprecated": false,
|
||||
"description": "",
|
||||
"example": undefined,
|
||||
"expanded": undefined,
|
||||
"explode": false,
|
||||
"in": undefined,
|
||||
"kind": "field",
|
||||
"name": "packSize",
|
||||
"required": false,
|
||||
"schema": SchemaModel {
|
||||
"activeOneOf": 0,
|
||||
<div>
|
||||
<styled.div>
|
||||
<Styled(styled.h2)>
|
||||
Dog
|
||||
</Styled(styled.h2)>
|
||||
<styled.div>
|
||||
<Markdown
|
||||
compact={true}
|
||||
source=""
|
||||
/>
|
||||
</styled.div>
|
||||
</styled.div>
|
||||
<styled.table>
|
||||
<tbody>
|
||||
<Field
|
||||
expandByDefault={false}
|
||||
field={
|
||||
FieldModel {
|
||||
"const": "",
|
||||
"constraints": Array [],
|
||||
"contentEncoding": undefined,
|
||||
"contentMediaType": undefined,
|
||||
"default": undefined,
|
||||
"deprecated": false,
|
||||
"description": "",
|
||||
"displayFormat": undefined,
|
||||
"displayType": "number",
|
||||
"enum": Array [],
|
||||
"example": undefined,
|
||||
"examples": undefined,
|
||||
"externalDocs": undefined,
|
||||
"format": undefined,
|
||||
"isCircular": false,
|
||||
"isPrimitive": true,
|
||||
"maxItems": undefined,
|
||||
"minItems": undefined,
|
||||
"options": "<<<filtered>>>",
|
||||
"pattern": undefined,
|
||||
"pointer": "#/components/schemas/Dog/properties/packSize",
|
||||
"rawSchema": Object {
|
||||
"expanded": undefined,
|
||||
"explode": false,
|
||||
"in": undefined,
|
||||
"kind": "field",
|
||||
"name": "packSize",
|
||||
"required": false,
|
||||
"schema": SchemaModel {
|
||||
"activeOneOf": 0,
|
||||
"const": "",
|
||||
"constraints": Array [],
|
||||
"contentEncoding": undefined,
|
||||
"contentMediaType": undefined,
|
||||
"default": undefined,
|
||||
"deprecated": false,
|
||||
"description": "",
|
||||
"displayFormat": undefined,
|
||||
"displayType": "number",
|
||||
"enum": Array [],
|
||||
"example": undefined,
|
||||
"examples": undefined,
|
||||
"externalDocs": undefined,
|
||||
"format": undefined,
|
||||
"isCircular": false,
|
||||
"isPrimitive": true,
|
||||
"maxItems": undefined,
|
||||
"minItems": undefined,
|
||||
"options": "<<<filtered>>>",
|
||||
"pattern": undefined,
|
||||
"pointer": "#/components/schemas/Dog/properties/packSize",
|
||||
"rawSchema": Object {
|
||||
"default": undefined,
|
||||
"type": "number",
|
||||
},
|
||||
"readOnly": false,
|
||||
"refsStack": Array [
|
||||
"#/components/schemas/Dog",
|
||||
"#/components/schemas/Dog/properties/packSize",
|
||||
],
|
||||
"schema": Object {
|
||||
"default": undefined,
|
||||
"type": "number",
|
||||
},
|
||||
"title": "",
|
||||
"type": "number",
|
||||
"typePrefix": "",
|
||||
"writeOnly": false,
|
||||
},
|
||||
"readOnly": false,
|
||||
"refsStack": Array [
|
||||
"#/components/schemas/Dog",
|
||||
"#/components/schemas/Dog/properties/packSize",
|
||||
],
|
||||
"schema": Object {
|
||||
"default": undefined,
|
||||
"type": "number",
|
||||
},
|
||||
"title": "",
|
||||
"type": "number",
|
||||
"typePrefix": "",
|
||||
"writeOnly": false,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
isLast={false}
|
||||
key="packSize"
|
||||
showExamples={false}
|
||||
/>
|
||||
<Field
|
||||
expandByDefault={false}
|
||||
field={
|
||||
FieldModel {
|
||||
"const": "",
|
||||
"deprecated": false,
|
||||
"description": "",
|
||||
"example": undefined,
|
||||
"expanded": undefined,
|
||||
"explode": false,
|
||||
"in": undefined,
|
||||
"kind": "field",
|
||||
"name": "type",
|
||||
"required": true,
|
||||
"schema": SchemaModel {
|
||||
"activeOneOf": 0,
|
||||
isLast={false}
|
||||
key="packSize"
|
||||
showExamples={false}
|
||||
/>
|
||||
<Field
|
||||
expandByDefault={false}
|
||||
field={
|
||||
FieldModel {
|
||||
"const": "",
|
||||
"constraints": Array [],
|
||||
"contentEncoding": undefined,
|
||||
"contentMediaType": undefined,
|
||||
"default": undefined,
|
||||
"deprecated": false,
|
||||
"description": "",
|
||||
"displayFormat": undefined,
|
||||
"displayType": "string",
|
||||
"enum": Array [],
|
||||
"example": undefined,
|
||||
"examples": undefined,
|
||||
"externalDocs": undefined,
|
||||
"format": undefined,
|
||||
"isCircular": false,
|
||||
"isPrimitive": true,
|
||||
"maxItems": undefined,
|
||||
"minItems": undefined,
|
||||
"options": "<<<filtered>>>",
|
||||
"pattern": undefined,
|
||||
"pointer": "#/components/schemas/Dog/properties/type",
|
||||
"rawSchema": Object {
|
||||
"expanded": undefined,
|
||||
"explode": false,
|
||||
"in": undefined,
|
||||
"kind": "field",
|
||||
"name": "type",
|
||||
"required": true,
|
||||
"schema": SchemaModel {
|
||||
"activeOneOf": 0,
|
||||
"const": "",
|
||||
"constraints": Array [],
|
||||
"contentEncoding": undefined,
|
||||
"contentMediaType": undefined,
|
||||
"default": undefined,
|
||||
"type": "string",
|
||||
"x-refsStack": Array [
|
||||
"deprecated": false,
|
||||
"description": "",
|
||||
"displayFormat": undefined,
|
||||
"displayType": "string",
|
||||
"enum": Array [],
|
||||
"example": undefined,
|
||||
"examples": undefined,
|
||||
"externalDocs": undefined,
|
||||
"format": undefined,
|
||||
"isCircular": false,
|
||||
"isPrimitive": true,
|
||||
"maxItems": undefined,
|
||||
"minItems": undefined,
|
||||
"options": "<<<filtered>>>",
|
||||
"pattern": undefined,
|
||||
"pointer": "#/components/schemas/Dog/properties/type",
|
||||
"rawSchema": Object {
|
||||
"default": undefined,
|
||||
"type": "string",
|
||||
"x-refsStack": Array [
|
||||
"#/components/schemas/Dog",
|
||||
"#/components/schemas/Pet",
|
||||
],
|
||||
},
|
||||
"readOnly": false,
|
||||
"refsStack": Array [
|
||||
"#/components/schemas/Dog",
|
||||
"#/components/schemas/Dog",
|
||||
"#/components/schemas/Pet",
|
||||
],
|
||||
},
|
||||
"readOnly": false,
|
||||
"refsStack": Array [
|
||||
"#/components/schemas/Dog",
|
||||
"#/components/schemas/Dog",
|
||||
"#/components/schemas/Pet",
|
||||
"#/components/schemas/Dog",
|
||||
"#/components/schemas/Pet",
|
||||
"#/components/schemas/Dog/properties/type",
|
||||
],
|
||||
"schema": Object {
|
||||
"default": undefined,
|
||||
"type": "string",
|
||||
"x-refsStack": Array [
|
||||
"#/components/schemas/Dog",
|
||||
"#/components/schemas/Pet",
|
||||
"#/components/schemas/Dog/properties/type",
|
||||
],
|
||||
"schema": Object {
|
||||
"default": undefined,
|
||||
"type": "string",
|
||||
"x-refsStack": Array [
|
||||
"#/components/schemas/Dog",
|
||||
"#/components/schemas/Pet",
|
||||
],
|
||||
},
|
||||
"title": "",
|
||||
"type": "string",
|
||||
"typePrefix": "",
|
||||
"writeOnly": false,
|
||||
},
|
||||
"title": "",
|
||||
"type": "string",
|
||||
"typePrefix": "",
|
||||
"writeOnly": false,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
isLast={true}
|
||||
key="type"
|
||||
renderDiscriminatorSwitch={[Function]}
|
||||
showExamples={false}
|
||||
/>
|
||||
</tbody>
|
||||
</styled.table>
|
||||
isLast={true}
|
||||
key="type"
|
||||
renderDiscriminatorSwitch={[Function]}
|
||||
showExamples={false}
|
||||
/>
|
||||
</tbody>
|
||||
</styled.table>
|
||||
</div>
|
||||
`;
|
||||
|
|
|
@ -159,7 +159,7 @@ exports[`FieldDetailsComponent renders correctly when field items have string ty
|
|||
</span>
|
||||
</span>
|
||||
<span
|
||||
class="sc-kpDqfm sc-dAlyuH sc-dxcDKg cGRfjn gHomYR gXntsr"
|
||||
class="sc-kpDqfm sc-dAlyuH sc-knuQbY cGRfjn gHomYR fhHPsm"
|
||||
>
|
||||
[
|
||||
<span
|
||||
|
|
|
@ -3,21 +3,21 @@
|
|||
exports[`SecurityRequirement should render SecurityDefs 1`] = `
|
||||
"<div id=\\"section/Authentication/petstore_auth\\" data-section-id=\\"section/Authentication/petstore_auth\\" class=\\"sc-dcJsrY bBkGhy\\"><div class=\\"sc-kAyceB hBQWIZ\\"><div class=\\"sc-fqkvVR oJKYx\\"><h2 class=\\"sc-jXbUNg fWnwAh\\">petstore_auth</h2><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><p>Get access to data while protecting your account credentials.
|
||||
OAuth2 is also a safer and more secure way to give you access.</p>
|
||||
</div><div class=\\"sc-ejfMa-d a-DjBE\\"><div class=\\"sc-dkmUuB hFwAIA\\"><b>Security Scheme Type: </b><span>OAuth2</span></div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-dkmUuB hFwAIA\\"><b>Flow type: </b><code>implicit </code></div><div class=\\"sc-dkmUuB hFwAIA\\"><strong> Authorization URL: </strong><code><a target=\\"_blank\\" rel=\\"noopener noreferrer\\" href=\\"http://petstore.swagger.io/api/oauth/dialog\\">http://petstore.swagger.io/api/oauth/dialog</a></code></div><div class=\\"sc-dkmUuB hFwAIA\\"><b> Scopes: </b></div><div class=\\"sc-iEXKAA blExNw container\\" style=\\"height: 4em;\\"><ul><li><code>write:pets</code> - <div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru sc-fhzFiK hXtrri redoc-markdown\\"><p>modify pets in your account</p>
|
||||
</div><div class=\\"sc-eZYNyq fYQLSg\\"><div class=\\"sc-EgOXT GPHWZ\\"><b>Security Scheme Type: </b><span>OAuth2</span></div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-EgOXT GPHWZ\\"><b>Flow type: </b><code>implicit </code></div><div class=\\"sc-EgOXT GPHWZ\\"><strong> Authorization URL: </strong><code><a target=\\"_blank\\" rel=\\"noopener noreferrer\\" href=\\"http://petstore.swagger.io/api/oauth/dialog\\">http://petstore.swagger.io/api/oauth/dialog</a></code></div><div class=\\"sc-EgOXT GPHWZ\\"><b> Scopes: </b></div><div class=\\"sc-dlWCHZ eWGZCd container\\" style=\\"height: 4em;\\"><ul><li><code>write:pets</code> - <div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru sc-fhzFiK hXtrri redoc-markdown\\"><p>modify pets in your account</p>
|
||||
</div></li><li><code>read:pets</code> - <div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru sc-fhzFiK hXtrri redoc-markdown\\"><p>read your pets</p>
|
||||
</div></li></ul></div><div class=\\"sc-EgOXT bNSpXO\\"></div></div></div></div></div></div><div id=\\"section/Authentication/GitLab_PersonalAccessToken\\" data-section-id=\\"section/Authentication/GitLab_PersonalAccessToken\\" class=\\"sc-dcJsrY bBkGhy\\"><div class=\\"sc-kAyceB hBQWIZ\\"><div class=\\"sc-fqkvVR oJKYx\\"><h2 class=\\"sc-jXbUNg fWnwAh\\">GitLab_PersonalAccessToken</h2><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><p>GitLab Personal Access Token description</p>
|
||||
</div><div class=\\"sc-ejfMa-d a-DjBE\\"><div class=\\"sc-dkmUuB hFwAIA\\"><b>Security Scheme Type: </b><span>API Key</span></div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-dkmUuB hFwAIA\\"><b>Header parameter name: </b><code>PRIVATE-TOKEN</code></div></div></div></div></div></div><div id=\\"section/Authentication/GitLab_OpenIdConnect\\" data-section-id=\\"section/Authentication/GitLab_OpenIdConnect\\" class=\\"sc-dcJsrY bBkGhy\\"><div class=\\"sc-kAyceB hBQWIZ\\"><div class=\\"sc-fqkvVR oJKYx\\"><h2 class=\\"sc-jXbUNg fWnwAh\\">GitLab_OpenIdConnect</h2><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><p>GitLab OpenIdConnect description</p>
|
||||
</div><div class=\\"sc-ejfMa-d a-DjBE\\"><div class=\\"sc-dkmUuB hFwAIA\\"><b>Security Scheme Type: </b><span>OpenID Connect</span></div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-dkmUuB hFwAIA\\"><b>Connect URL: </b><code><a target=\\"_blank\\" rel=\\"noopener noreferrer\\" href=\\"https://gitlab.com/.well-known/openid-configuration\\">https://gitlab.com/.well-known/openid-configuration</a></code></div></div></div></div></div></div><div id=\\"section/Authentication/basicAuth\\" data-section-id=\\"section/Authentication/basicAuth\\" class=\\"sc-dcJsrY bBkGhy\\"><div class=\\"sc-kAyceB hBQWIZ\\"><div class=\\"sc-fqkvVR oJKYx\\"><h2 class=\\"sc-jXbUNg fWnwAh\\">basicAuth</h2><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"></div><div class=\\"sc-ejfMa-d a-DjBE\\"><div class=\\"sc-dkmUuB hFwAIA\\"><b>Security Scheme Type: </b><span>HTTP</span></div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-dkmUuB hFwAIA\\"><b>HTTP Authorization Scheme: </b><code>basic</code></div><div class=\\"sc-dkmUuB hFwAIA\\"></div></div></div></div></div></div>"
|
||||
</div></li></ul></div><div class=\\"sc-hHOBiw zjoZc\\"></div></div></div></div></div></div><div id=\\"section/Authentication/GitLab_PersonalAccessToken\\" data-section-id=\\"section/Authentication/GitLab_PersonalAccessToken\\" class=\\"sc-dcJsrY bBkGhy\\"><div class=\\"sc-kAyceB hBQWIZ\\"><div class=\\"sc-fqkvVR oJKYx\\"><h2 class=\\"sc-jXbUNg fWnwAh\\">GitLab_PersonalAccessToken</h2><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><p>GitLab Personal Access Token description</p>
|
||||
</div><div class=\\"sc-eZYNyq fYQLSg\\"><div class=\\"sc-EgOXT GPHWZ\\"><b>Security Scheme Type: </b><span>API Key</span></div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-EgOXT GPHWZ\\"><b>Header parameter name: </b><code>PRIVATE-TOKEN</code></div></div></div></div></div></div><div id=\\"section/Authentication/GitLab_OpenIdConnect\\" data-section-id=\\"section/Authentication/GitLab_OpenIdConnect\\" class=\\"sc-dcJsrY bBkGhy\\"><div class=\\"sc-kAyceB hBQWIZ\\"><div class=\\"sc-fqkvVR oJKYx\\"><h2 class=\\"sc-jXbUNg fWnwAh\\">GitLab_OpenIdConnect</h2><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><p>GitLab OpenIdConnect description</p>
|
||||
</div><div class=\\"sc-eZYNyq fYQLSg\\"><div class=\\"sc-EgOXT GPHWZ\\"><b>Security Scheme Type: </b><span>OpenID Connect</span></div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-EgOXT GPHWZ\\"><b>Connect URL: </b><code><a target=\\"_blank\\" rel=\\"noopener noreferrer\\" href=\\"https://gitlab.com/.well-known/openid-configuration\\">https://gitlab.com/.well-known/openid-configuration</a></code></div></div></div></div></div></div><div id=\\"section/Authentication/basicAuth\\" data-section-id=\\"section/Authentication/basicAuth\\" class=\\"sc-dcJsrY bBkGhy\\"><div class=\\"sc-kAyceB hBQWIZ\\"><div class=\\"sc-fqkvVR oJKYx\\"><h2 class=\\"sc-jXbUNg fWnwAh\\">basicAuth</h2><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"></div><div class=\\"sc-eZYNyq fYQLSg\\"><div class=\\"sc-EgOXT GPHWZ\\"><b>Security Scheme Type: </b><span>HTTP</span></div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-EgOXT GPHWZ\\"><b>HTTP Authorization Scheme: </b><code>basic</code></div><div class=\\"sc-EgOXT GPHWZ\\"></div></div></div></div></div></div>"
|
||||
`;
|
||||
|
||||
exports[`SecurityRequirement should render authDefinition 1`] = `"<div class=\\"sc-bDumWk iWBBny\\"><div class=\\"sc-sLsrZ hgeUJn\\"><h5 class=\\"sc-dAlyuH sc-fifgRP jbQuod kWJur\\">Authorizations:</h5><svg class=\\"sc-cwHptR iZRiKW\\" version=\\"1.1\\" viewBox=\\"0 0 24 24\\" x=\\"0\\" xmlns=\\"http://www.w3.org/2000/svg\\" y=\\"0\\" aria-hidden=\\"true\\"><polygon points=\\"17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 \\"></polygon></svg></div><div class=\\"sc-dBmzty eoFcYg\\"><span class=\\"sc-kbousE cpXQuZ\\">(<span class=\\"sc-gfoqjT kbvnry\\">API Key: <i>GitLab_PersonalAccessToken</i></span><span class=\\"sc-gfoqjT kbvnry\\">OpenID Connect: <i>GitLab_OpenIdConnect</i></span><span class=\\"sc-gfoqjT kbvnry\\">HTTP: <i>basicAuth</i></span>) </span><span class=\\"sc-kbousE cpXQuZ\\"><span class=\\"sc-gfoqjT kbvnry\\">OAuth2: <i>petstore_auth</i></span></span></div></div>,"`;
|
||||
exports[`SecurityRequirement should render authDefinition 1`] = `"<div class=\\"sc-iEXKAA jcxXwP\\"><div class=\\"sc-bDumWk bGSpwN\\"><h5 class=\\"sc-dAlyuH sc-ejfMa-d jbQuod fmqXEj\\">Authorizations:</h5><svg class=\\"sc-cwHptR iZRiKW\\" version=\\"1.1\\" viewBox=\\"0 0 24 24\\" x=\\"0\\" xmlns=\\"http://www.w3.org/2000/svg\\" y=\\"0\\" aria-hidden=\\"true\\"><polygon points=\\"17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 \\"></polygon></svg></div><div class=\\"sc-dkmUuB hSVZwQ\\"><span class=\\"sc-fifgRP dCXXEI\\">(<span class=\\"sc-dBmzty lnpucz\\">API Key: <i>GitLab_PersonalAccessToken</i></span><span class=\\"sc-dBmzty lnpucz\\">OpenID Connect: <i>GitLab_OpenIdConnect</i></span><span class=\\"sc-dBmzty lnpucz\\">HTTP: <i>basicAuth</i></span>) </span><span class=\\"sc-fifgRP dCXXEI\\"><span class=\\"sc-dBmzty lnpucz\\">OAuth2: <i>petstore_auth</i></span></span></div></div>,"`;
|
||||
|
||||
exports[`SecurityRequirement should render authDefinition 2`] = `
|
||||
"<div class=\\"sc-bDumWk gtsPcy\\"><div class=\\"sc-sLsrZ hgeUJn\\"><h5 class=\\"sc-dAlyuH sc-fifgRP jbQuod kWJur\\">Authorizations:</h5><svg class=\\"sc-cwHptR dSJqIk\\" version=\\"1.1\\" viewBox=\\"0 0 24 24\\" x=\\"0\\" xmlns=\\"http://www.w3.org/2000/svg\\" y=\\"0\\" aria-hidden=\\"true\\"><polygon points=\\"17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 \\"></polygon></svg></div><div class=\\"sc-dBmzty llvZdI\\"><span class=\\"sc-kbousE dOwJQz\\">(<span class=\\"sc-gfoqjT kbvnry\\">API Key: <i>GitLab_PersonalAccessToken</i></span><span class=\\"sc-gfoqjT kbvnry\\">OpenID Connect: <i>GitLab_OpenIdConnect</i></span><span class=\\"sc-gfoqjT kbvnry\\">HTTP: <i>basicAuth</i></span>) </span><span class=\\"sc-kbousE dOwJQz\\"><span class=\\"sc-gfoqjT kbvnry\\">OAuth2: <i>petstore_auth</i> (<code class=\\"sc-eyvILC bzHwfc\\">write:pets</code><code class=\\"sc-eyvILC bzHwfc\\">read:pets</code>) </span></span></div></div><div class=\\"sc-ejfMa-d a-DjBE\\"><h5><svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" width=\\"11\\" height=\\"11\\"><path fill=\\"currentColor\\" d=\\"M18 10V6A6 6 0 0 0 6 6v4H3v14h18V10h-3zM8 6c0-2.206 1.794-4 4-4s4 1.794 4 4v4H8V6zm11 16H5V12h14v10z\\"></path></svg> OAuth2: petstore_auth</h5><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><p>Get access to data while protecting your account credentials.
|
||||
"<div class=\\"sc-iEXKAA frhMMv\\"><div class=\\"sc-bDumWk bGSpwN\\"><h5 class=\\"sc-dAlyuH sc-ejfMa-d jbQuod fmqXEj\\">Authorizations:</h5><svg class=\\"sc-cwHptR dSJqIk\\" version=\\"1.1\\" viewBox=\\"0 0 24 24\\" x=\\"0\\" xmlns=\\"http://www.w3.org/2000/svg\\" y=\\"0\\" aria-hidden=\\"true\\"><polygon points=\\"17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 \\"></polygon></svg></div><div class=\\"sc-dkmUuB kAGRNw\\"><span class=\\"sc-fifgRP tCRMq\\">(<span class=\\"sc-dBmzty lnpucz\\">API Key: <i>GitLab_PersonalAccessToken</i></span><span class=\\"sc-dBmzty lnpucz\\">OpenID Connect: <i>GitLab_OpenIdConnect</i></span><span class=\\"sc-dBmzty lnpucz\\">HTTP: <i>basicAuth</i></span>) </span><span class=\\"sc-fifgRP tCRMq\\"><span class=\\"sc-dBmzty lnpucz\\">OAuth2: <i>petstore_auth</i> (<code class=\\"sc-sLsrZ IIDgM\\">write:pets</code><code class=\\"sc-sLsrZ IIDgM\\">read:pets</code>) </span></span></div></div><div class=\\"sc-eZYNyq fYQLSg\\"><h5><svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" width=\\"11\\" height=\\"11\\"><path fill=\\"currentColor\\" d=\\"M18 10V6A6 6 0 0 0 6 6v4H3v14h18V10h-3zM8 6c0-2.206 1.794-4 4-4s4 1.794 4 4v4H8V6zm11 16H5V12h14v10z\\"></path></svg> OAuth2: petstore_auth</h5><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><p>Get access to data while protecting your account credentials.
|
||||
OAuth2 is also a safer and more secure way to give you access.</p>
|
||||
</div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-dkmUuB hFwAIA\\"><b>Flow type: </b><code>implicit </code></div><div class=\\"sc-dkmUuB hFwAIA\\"><strong> Authorization URL: </strong><code><a target=\\"_blank\\" rel=\\"noopener noreferrer\\" href=\\"http://petstore.swagger.io/api/oauth/dialog\\">http://petstore.swagger.io/api/oauth/dialog</a></code></div><div><b>Required scopes: </b><code>write:pets</code> <code>read:pets</code> </div><div class=\\"sc-dkmUuB hFwAIA\\"><b> Scopes: </b></div><div class=\\"sc-iEXKAA blExNw container\\" style=\\"height: 4em;\\"><ul><li><code>write:pets</code> - <div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru sc-fhzFiK hXtrri redoc-markdown\\"><p>modify pets in your account</p>
|
||||
</div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-EgOXT GPHWZ\\"><b>Flow type: </b><code>implicit </code></div><div class=\\"sc-EgOXT GPHWZ\\"><strong> Authorization URL: </strong><code><a target=\\"_blank\\" rel=\\"noopener noreferrer\\" href=\\"http://petstore.swagger.io/api/oauth/dialog\\">http://petstore.swagger.io/api/oauth/dialog</a></code></div><div><b>Required scopes: </b><code>write:pets</code> <code>read:pets</code> </div><div class=\\"sc-EgOXT GPHWZ\\"><b> Scopes: </b></div><div class=\\"sc-dlWCHZ eWGZCd container\\" style=\\"height: 4em;\\"><ul><li><code>write:pets</code> - <div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru sc-fhzFiK hXtrri redoc-markdown\\"><p>modify pets in your account</p>
|
||||
</div></li><li><code>read:pets</code> - <div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru sc-fhzFiK hXtrri redoc-markdown\\"><p>read your pets</p>
|
||||
</div></li></ul></div><div class=\\"sc-EgOXT bNSpXO\\"></div></div></div><div class=\\"sc-ejfMa-d a-DjBE\\"><h5><svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" width=\\"11\\" height=\\"11\\"><path fill=\\"currentColor\\" d=\\"M18 10V6A6 6 0 0 0 6 6v4H3v14h18V10h-3zM8 6c0-2.206 1.794-4 4-4s4 1.794 4 4v4H8V6zm11 16H5V12h14v10z\\"></path></svg> API Key: GitLab_PersonalAccessToken</h5><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><p>GitLab Personal Access Token description</p>
|
||||
</div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-dkmUuB hFwAIA\\"><b>Header parameter name: </b><code>PRIVATE-TOKEN</code></div></div></div><div class=\\"sc-ejfMa-d a-DjBE\\"><h5><svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" width=\\"11\\" height=\\"11\\"><path fill=\\"currentColor\\" d=\\"M18 10V6A6 6 0 0 0 6 6v4H3v14h18V10h-3zM8 6c0-2.206 1.794-4 4-4s4 1.794 4 4v4H8V6zm11 16H5V12h14v10z\\"></path></svg> OpenID Connect: GitLab_OpenIdConnect</h5><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><p>GitLab OpenIdConnect description</p>
|
||||
</div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-dkmUuB hFwAIA\\"><b>Connect URL: </b><code><a target=\\"_blank\\" rel=\\"noopener noreferrer\\" href=\\"https://gitlab.com/.well-known/openid-configuration\\">https://gitlab.com/.well-known/openid-configuration</a></code></div></div></div><div class=\\"sc-ejfMa-d a-DjBE\\"><h5><svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" width=\\"11\\" height=\\"11\\"><path fill=\\"currentColor\\" d=\\"M18 10V6A6 6 0 0 0 6 6v4H3v14h18V10h-3zM8 6c0-2.206 1.794-4 4-4s4 1.794 4 4v4H8V6zm11 16H5V12h14v10z\\"></path></svg> HTTP: basicAuth</h5><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"></div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-dkmUuB hFwAIA\\"><b>HTTP Authorization Scheme: </b><code>basic</code></div><div class=\\"sc-dkmUuB hFwAIA\\"></div></div></div>,"
|
||||
</div></li></ul></div><div class=\\"sc-hHOBiw zjoZc\\"></div></div></div><div class=\\"sc-eZYNyq fYQLSg\\"><h5><svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" width=\\"11\\" height=\\"11\\"><path fill=\\"currentColor\\" d=\\"M18 10V6A6 6 0 0 0 6 6v4H3v14h18V10h-3zM8 6c0-2.206 1.794-4 4-4s4 1.794 4 4v4H8V6zm11 16H5V12h14v10z\\"></path></svg> API Key: GitLab_PersonalAccessToken</h5><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><p>GitLab Personal Access Token description</p>
|
||||
</div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-EgOXT GPHWZ\\"><b>Header parameter name: </b><code>PRIVATE-TOKEN</code></div></div></div><div class=\\"sc-eZYNyq fYQLSg\\"><h5><svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" width=\\"11\\" height=\\"11\\"><path fill=\\"currentColor\\" d=\\"M18 10V6A6 6 0 0 0 6 6v4H3v14h18V10h-3zM8 6c0-2.206 1.794-4 4-4s4 1.794 4 4v4H8V6zm11 16H5V12h14v10z\\"></path></svg> OpenID Connect: GitLab_OpenIdConnect</h5><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><p>GitLab OpenIdConnect description</p>
|
||||
</div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-EgOXT GPHWZ\\"><b>Connect URL: </b><code><a target=\\"_blank\\" rel=\\"noopener noreferrer\\" href=\\"https://gitlab.com/.well-known/openid-configuration\\">https://gitlab.com/.well-known/openid-configuration</a></code></div></div></div><div class=\\"sc-eZYNyq fYQLSg\\"><h5><svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" width=\\"11\\" height=\\"11\\"><path fill=\\"currentColor\\" d=\\"M18 10V6A6 6 0 0 0 6 6v4H3v14h18V10h-3zM8 6c0-2.206 1.794-4 4-4s4 1.794 4 4v4H8V6zm11 16H5V12h14v10z\\"></path></svg> HTTP: basicAuth</h5><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"></div><div class=\\"sc-eeDRCY sc-eBMEME gTGgei fMmru\\"><div class=\\"sc-EgOXT GPHWZ\\"><b>HTTP Authorization Scheme: </b><code>basic</code></div><div class=\\"sc-EgOXT GPHWZ\\"></div></div></div>,"
|
||||
`;
|
||||
|
|
|
@ -39,6 +39,8 @@ export interface RedocRawOptions {
|
|||
showObjectSchemaExamples?: boolean | string;
|
||||
showSecuritySchemeType?: boolean;
|
||||
hideSecuritySection?: boolean;
|
||||
hideObjectTitle?: boolean | string;
|
||||
hideObjectDescription?: boolean | string;
|
||||
|
||||
unstable_ignoreMimeParameters?: boolean;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user