mirror of
https://github.com/Redocly/redoc.git
synced 2025-07-29 17:40:05 +03:00
Update 217 files
This commit is contained in:
parent
eff730bada
commit
fb55aa5456
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -19,12 +19,12 @@ npm-debug.log*
|
|||
|
||||
# Dependency directory
|
||||
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
|
||||
node_modules
|
||||
# node_modules
|
||||
|
||||
lib/
|
||||
stats.json
|
||||
cypress/
|
||||
bundles/
|
||||
# bundles/
|
||||
typings/*
|
||||
!typings/styled-patch.d.ts
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ export class SectionItem extends React.Component<ContentItemProps> {
|
|||
<>
|
||||
<Row>
|
||||
<MiddlePanel compact={false}>
|
||||
<Header>
|
||||
<Header className="sar-header">
|
||||
<ShareLink to={this.props.item.id} />
|
||||
{name}
|
||||
</Header>
|
||||
|
|
|
@ -65,7 +65,9 @@ export class Field extends React.Component<FieldProps> {
|
|||
|
||||
const paramName = withSubSchema ? (
|
||||
<ClickablePropertyNameCell
|
||||
className={deprecated ? 'deprecated' : ''}
|
||||
className={
|
||||
deprecated ? 'deprecated ClickablePropertyNameCell' : 'ClickablePropertyNameCell'
|
||||
}
|
||||
kind={kind}
|
||||
title={name}
|
||||
>
|
||||
|
@ -92,12 +94,12 @@ export class Field extends React.Component<FieldProps> {
|
|||
<>
|
||||
<tr className={isLast ? 'last ' + className : className}>
|
||||
{paramName}
|
||||
<PropertyDetailsCell>
|
||||
<FieldDetails {...this.props} />
|
||||
<PropertyDetailsCell className={'PropertyDetailsCell ' + field.name}>
|
||||
<FieldDetails {...this.props} className="FieldDetails" />
|
||||
</PropertyDetailsCell>
|
||||
</tr>
|
||||
{expanded && withSubSchema && (
|
||||
<tr key={field.name + 'inner'}>
|
||||
<tr key={field.name + 'inner'} className="sar-tr">
|
||||
<PropertyCellWithInner colSpan={2}>
|
||||
<InnerPropertiesWrap>
|
||||
<Schema
|
||||
|
|
|
@ -14,7 +14,10 @@ export class ConstraintsView extends React.PureComponent<ConstraintsViewProps> {
|
|||
<span>
|
||||
{' '}
|
||||
{this.props.constraints.map(constraint => (
|
||||
<ConstraintItem key={constraint}> {constraint} </ConstraintItem>
|
||||
<ConstraintItem key={constraint} className="sar-ConstraintItem">
|
||||
{' '}
|
||||
{constraint}{' '}
|
||||
</ConstraintItem>
|
||||
))}
|
||||
</span>
|
||||
);
|
||||
|
|
|
@ -16,7 +16,8 @@ function FieldDetailComponent({ value, label, raw }: FieldDetailProps) {
|
|||
|
||||
return (
|
||||
<div>
|
||||
<FieldLabel> {label} </FieldLabel> <ExampleValue>{stringifyValue}</ExampleValue>
|
||||
<FieldLabel> {label} </FieldLabel>{' '}
|
||||
<ExampleValue className="sar-ExampleValue">{stringifyValue}</ExampleValue>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,15 @@ export const FieldDetailsComponent = observer((props: FieldProps) => {
|
|||
const { enumSkipQuotes, hideSchemaTitles } = React.useContext(OptionsContext);
|
||||
|
||||
const { showExamples, field, renderDiscriminatorSwitch } = props;
|
||||
const { schema, description, deprecated, extensions, in: _in, const: _const } = field;
|
||||
const {
|
||||
schema,
|
||||
description,
|
||||
descriptionClass,
|
||||
deprecated,
|
||||
extensions,
|
||||
in: _in,
|
||||
const: _const,
|
||||
} = field;
|
||||
const isArrayType = schema.type === 'array';
|
||||
|
||||
const rawDefault = enumSkipQuotes || _in === 'header'; // having quotes around header field default values is confusing and inappropriate
|
||||
|
@ -57,10 +65,10 @@ export const FieldDetailsComponent = observer((props: FieldProps) => {
|
|||
: schema.default;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div>
|
||||
<div className="FieldDetailsDiv">
|
||||
<div className="FieldDetailsDiv__childDiv1">
|
||||
<TypePrefix>{schema.typePrefix}</TypePrefix>
|
||||
<TypeName>{schema.displayType}</TypeName>
|
||||
<TypeName className="sar-TypeName">{schema.displayType}</TypeName>
|
||||
{schema.displayFormat && (
|
||||
<TypeFormat>
|
||||
{' '}
|
||||
|
@ -96,20 +104,29 @@ export const FieldDetailsComponent = observer((props: FieldProps) => {
|
|||
<Badge type="warning"> {l('deprecated')} </Badge>
|
||||
</div>
|
||||
)}
|
||||
<FieldDetail raw={rawDefault} label={l('default') + ':'} value={defaultValue} />
|
||||
{!renderDiscriminatorSwitch && (
|
||||
<EnumValues isArrayType={isArrayType} values={schema.enum} />
|
||||
)}{' '}
|
||||
{renderedExamples}
|
||||
<Extensions extensions={{ ...extensions, ...schema.extensions }} />
|
||||
<div>
|
||||
<div className="FieldDetailsDiv__childDiv2">
|
||||
<FieldDetail raw={rawDefault} label={l('default') + ':'} value={defaultValue} />
|
||||
</div>
|
||||
|
||||
<div className="FieldDetailsDiv__childDiv3">
|
||||
{!renderDiscriminatorSwitch && (
|
||||
<EnumValues isArrayType={isArrayType} values={schema.enum} />
|
||||
)}{' '}
|
||||
{renderedExamples}
|
||||
</div>
|
||||
<div className="FieldDetailsDiv__childDiv4">
|
||||
<Extensions extensions={{ ...extensions, ...schema.extensions }} />
|
||||
</div>
|
||||
<div className={descriptionClass + ' FieldDetailsDiv__description'}>
|
||||
<Markdown compact={true} source={description} />
|
||||
</div>
|
||||
{schema.externalDocs && (
|
||||
<ExternalDocumentation externalDocs={schema.externalDocs} compact={true} />
|
||||
)}
|
||||
{(renderDiscriminatorSwitch && renderDiscriminatorSwitch(props)) || null}
|
||||
{(_const && <FieldDetail label={l('const') + ':'} value={_const} />) || null}
|
||||
<div className="FieldDetailsDiv__childDiv6">
|
||||
{schema.externalDocs && (
|
||||
<ExternalDocumentation externalDocs={schema.externalDocs} compact={true} />
|
||||
)}
|
||||
{(renderDiscriminatorSwitch && renderDiscriminatorSwitch(props)) || null}
|
||||
{(_const && <FieldDetail label={l('const') + ':'} value={_const} />) || null}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
|
|
@ -10,7 +10,17 @@ export interface ResponseViewProps {
|
|||
}
|
||||
|
||||
export const ResponseView = observer(({ response }: ResponseViewProps): React.ReactElement => {
|
||||
const { extensions, headers, type, summary, description, code, expanded, content } = response;
|
||||
const {
|
||||
extensions,
|
||||
headers,
|
||||
type,
|
||||
summary,
|
||||
description,
|
||||
descriptionClass,
|
||||
code,
|
||||
expanded,
|
||||
content,
|
||||
} = response;
|
||||
|
||||
const mimes = React.useMemo<MediaTypeModel[]>(
|
||||
() =>
|
||||
|
@ -29,14 +39,17 @@ export const ResponseView = observer(({ response }: ResponseViewProps): React.Re
|
|||
|
||||
return (
|
||||
<div>
|
||||
<StyledResponseTitle
|
||||
onClick={() => response.toggle()}
|
||||
type={type}
|
||||
empty={empty}
|
||||
title={summary || ''}
|
||||
code={code}
|
||||
opened={expanded}
|
||||
/>
|
||||
<span className="StyledResponseTitle">
|
||||
<StyledResponseTitle
|
||||
onClick={() => response.toggle()}
|
||||
type={type}
|
||||
empty={empty}
|
||||
title={summary || ''}
|
||||
descriptionClass={descriptionClass}
|
||||
code={code}
|
||||
opened={expanded}
|
||||
/>
|
||||
</span>
|
||||
{expanded && !empty && (
|
||||
<ResponseDetailsWrap>
|
||||
<ResponseDetails response={response} />
|
||||
|
|
|
@ -14,10 +14,12 @@ import { ConstraintsView } from '../Fields/FieldContstraints';
|
|||
|
||||
export class ResponseDetails extends React.PureComponent<{ response: ResponseModel }> {
|
||||
render() {
|
||||
const { description, extensions, headers, content } = this.props.response;
|
||||
const { description, descriptionClass, extensions, headers, content } = this.props.response;
|
||||
return (
|
||||
<>
|
||||
{description && <Markdown source={description} />}
|
||||
<span className={descriptionClass + ' ResponseDetails__description'}>
|
||||
{description && <Markdown source={description} />}
|
||||
</span>
|
||||
<Extensions extensions={extensions} />
|
||||
<ResponseHeaders headers={headers} />
|
||||
<MediaTypesSwitch content={content} renderDropdown={this.renderDropdown}>
|
||||
|
|
|
@ -8,6 +8,7 @@ export interface ResponseTitleProps {
|
|||
code: string;
|
||||
title: string;
|
||||
type: string;
|
||||
descriptionClass?: string;
|
||||
empty?: boolean;
|
||||
opened?: boolean;
|
||||
className?: string;
|
||||
|
@ -19,6 +20,7 @@ function ResponseTitleComponent({
|
|||
type,
|
||||
empty,
|
||||
code,
|
||||
descriptionClass,
|
||||
opened,
|
||||
className,
|
||||
onClick,
|
||||
|
@ -39,7 +41,9 @@ function ResponseTitleComponent({
|
|||
/>
|
||||
)}
|
||||
<Code>{code} </Code>
|
||||
<Markdown compact={true} inline={true} source={title} />
|
||||
<div className={descriptionClass + ' ResponseTitleComponent__Markdown'}>
|
||||
<Markdown compact={true} inline={true} source={title} />
|
||||
</div>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ export class ResponsesList extends React.PureComponent<ResponseListProps> {
|
|||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="ResponsesList">
|
||||
<ResponsesHeader>{isCallback ? l('callbackResponses') : l('responses')}</ResponsesHeader>
|
||||
{responses.map(response => {
|
||||
return <ResponseView key={response.code} response={response} />;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,53 +1,53 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Components SchemaView OneOf deprecated should match snapshot 1`] = `
|
||||
<div>
|
||||
<span
|
||||
class="sc-kfYoZR juYXUf"
|
||||
>
|
||||
One of
|
||||
</span>
|
||||
<div
|
||||
class="sc-dlMDgC EoFth"
|
||||
>
|
||||
<button
|
||||
class="sc-fKgJPI iEPbLk"
|
||||
>
|
||||
string
|
||||
</button>
|
||||
<button
|
||||
class="sc-fKgJPI bpjiHN"
|
||||
>
|
||||
integer
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<span
|
||||
class="sc-bqGGPW eSYQnm"
|
||||
type="warning"
|
||||
>
|
||||
Deprecated
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
<span
|
||||
class="sc-laZMeE sc-iNiQyp jWaWWE jrLlAa"
|
||||
/>
|
||||
<span
|
||||
class="sc-laZMeE sc-jffHpj jWaWWE cThoNa"
|
||||
>
|
||||
string
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div
|
||||
class="sc-iJCRrE sc-ciSkZP jCdxGr lhENGb"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Components SchemaView OneOf deprecated should match snapshot 1`] = `
|
||||
<div>
|
||||
<span
|
||||
class="sc-kfYoZR juYXUf"
|
||||
>
|
||||
One of
|
||||
</span>
|
||||
<div
|
||||
class="sc-dlMDgC EoFth"
|
||||
>
|
||||
<button
|
||||
class="sc-fKgJPI iEPbLk"
|
||||
>
|
||||
string
|
||||
</button>
|
||||
<button
|
||||
class="sc-fKgJPI bpjiHN"
|
||||
>
|
||||
integer
|
||||
</button>
|
||||
</div>
|
||||
<div>
|
||||
<span
|
||||
class="sc-bqGGPW eSYQnm"
|
||||
type="warning"
|
||||
>
|
||||
Deprecated
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
<span
|
||||
class="sc-laZMeE sc-iNiQyp jWaWWE jrLlAa"
|
||||
/>
|
||||
<span
|
||||
class="sc-laZMeE sc-jffHpj jWaWWE cThoNa"
|
||||
>
|
||||
string
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div
|
||||
class="sc-iJCRrE sc-ciSkZP jCdxGr lhENGb"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`SecurityRequirement should render SecurityDefs 1`] = `
|
||||
"<div id=\\"section/Authentication/petstore_auth\\" data-section-id=\\"section/Authentication/petstore_auth\\" class=\\"sc-eCApnc jlMQbh\\"><div class=\\"sc-iCoGMd gLxhOh\\"><div class=\\"sc-hKFxyN juinod\\"><h2 class=\\"sc-pNWdM eftmgB\\">petstore_auth</h2><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><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-eEVmNe lmbHgE\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>Security Scheme Type: </b><span>OAuth2</span></div><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>Flow type: </b><code>implicit </code></div><div class=\\"sc-jXcxbT gllWlr\\"><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-jXcxbT gllWlr\\"><b> Scopes: </b></div><div class=\\"sc-fmdNqN eKoRDV container\\" style=\\"height: 4em;\\"><ul><li><code>write:pets</code> - <span class=\\"sc-carFqZ bmTzxo redoc-markdown\\"><p>modify pets in your account</p>
|
||||
</span></li><li><code>read:pets</code> - <span class=\\"sc-carFqZ bmTzxo redoc-markdown\\"><p>read your pets</p>
|
||||
</span></li></ul></div><div class=\\"sc-ljsmAU blhEdv\\"></div></div></div></div></div></div><div id=\\"section/Authentication/GitLab_PersonalAccessToken\\" data-section-id=\\"section/Authentication/GitLab_PersonalAccessToken\\" class=\\"sc-eCApnc jlMQbh\\"><div class=\\"sc-iCoGMd gLxhOh\\"><div class=\\"sc-hKFxyN juinod\\"><h2 class=\\"sc-pNWdM eftmgB\\">GitLab_PersonalAccessToken</h2><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><p>GitLab Personal Access Token description</p>
|
||||
</div><div class=\\"sc-eEVmNe lmbHgE\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>Security Scheme Type: </b><span>API Key</span></div><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><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-eCApnc jlMQbh\\"><div class=\\"sc-iCoGMd gLxhOh\\"><div class=\\"sc-hKFxyN juinod\\"><h2 class=\\"sc-pNWdM eftmgB\\">GitLab_OpenIdConnect</h2><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><p>GitLab OpenIdConnect description</p>
|
||||
</div><div class=\\"sc-eEVmNe lmbHgE\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>Security Scheme Type: </b><span>OpenID Connect</span></div><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><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-eCApnc jlMQbh\\"><div class=\\"sc-iCoGMd gLxhOh\\"><div class=\\"sc-hKFxyN juinod\\"><h2 class=\\"sc-pNWdM eftmgB\\">basicAuth</h2><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"></div><div class=\\"sc-eEVmNe lmbHgE\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>Security Scheme Type: </b><span>HTTP</span></div><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>HTTP Authorization Scheme: </b><code>basic</code></div><div class=\\"sc-jXcxbT gllWlr\\"></div></div></div></div></div></div>"
|
||||
`;
|
||||
|
||||
exports[`SecurityRequirement should render authDefinition 1`] = `"<div class=\\"sc-EZqKI eriJMk\\"><div class=\\"sc-jHcXXw kurgNF\\"><h5 class=\\"sc-iqAclL sc-fXgAZx eONCmm xiVXt\\">Authorizations:</h5><svg class=\\"sc-dIsUp iPqByX\\" 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-bQCEYZ cCwYjG\\"><span class=\\"sc-dWBRfb hoKBYz\\">(<span class=\\"sc-xGAEC bCFTJj\\">API Key: <i>GitLab_PersonalAccessToken</i></span><span class=\\"sc-xGAEC bCFTJj\\">OpenID Connect: <i>GitLab_OpenIdConnect</i></span><span class=\\"sc-xGAEC bCFTJj\\">HTTP: <i>basicAuth</i></span>) </span><span class=\\"sc-dWBRfb hoKBYz\\"><span class=\\"sc-xGAEC bCFTJj\\">OAuth2: <i>petstore_auth</i></span></span></div></div>,"`;
|
||||
|
||||
exports[`SecurityRequirement should render authDefinition 2`] = `
|
||||
"<div class=\\"sc-EZqKI hSmRqE\\"><div class=\\"sc-jHcXXw kurgNF\\"><h5 class=\\"sc-iqAclL sc-fXgAZx eONCmm xiVXt\\">Authorizations:</h5><svg class=\\"sc-dIsUp fVWtGJ\\" 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-bQCEYZ gvMhNy\\"><span class=\\"sc-dWBRfb eLEzSd\\">(<span class=\\"sc-xGAEC bCFTJj\\">API Key: <i>GitLab_PersonalAccessToken</i></span><span class=\\"sc-xGAEC bCFTJj\\">OpenID Connect: <i>GitLab_OpenIdConnect</i></span><span class=\\"sc-xGAEC bCFTJj\\">HTTP: <i>basicAuth</i></span>) </span><span class=\\"sc-dWBRfb eLEzSd\\"><span class=\\"sc-xGAEC bCFTJj\\">OAuth2: <i>petstore_auth</i> (<code class=\\"sc-kYPZxB beMTTe\\">write:pets</code><code class=\\"sc-kYPZxB beMTTe\\">read:pets</code>) </span></span></div></div><div class=\\"sc-eEVmNe lmbHgE\\"><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-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><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-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>Flow type: </b><code>implicit </code></div><div class=\\"sc-jXcxbT gllWlr\\"><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-jXcxbT gllWlr\\"><b> Scopes: </b></div><div class=\\"sc-fmdNqN eKoRDV container\\" style=\\"height: 4em;\\"><ul><li><code>write:pets</code> - <span class=\\"sc-carFqZ bmTzxo redoc-markdown\\"><p>modify pets in your account</p>
|
||||
</span></li><li><code>read:pets</code> - <span class=\\"sc-carFqZ bmTzxo redoc-markdown\\"><p>read your pets</p>
|
||||
</span></li></ul></div><div class=\\"sc-ljsmAU blhEdv\\"></div></div></div><div class=\\"sc-eEVmNe lmbHgE\\"><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-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><p>GitLab Personal Access Token description</p>
|
||||
</div><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>Header parameter name: </b><code>PRIVATE-TOKEN</code></div></div></div><div class=\\"sc-eEVmNe lmbHgE\\"><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-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><p>GitLab OpenIdConnect description</p>
|
||||
</div><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><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-eEVmNe lmbHgE\\"><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-iJCRrE sc-ciSkZP jCdxGr QGruV\\"></div><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>HTTP Authorization Scheme: </b><code>basic</code></div><div class=\\"sc-jXcxbT gllWlr\\"></div></div></div>,"
|
||||
`;
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`SecurityRequirement should render SecurityDefs 1`] = `
|
||||
"<div id=\\"section/Authentication/petstore_auth\\" data-section-id=\\"section/Authentication/petstore_auth\\" class=\\"sc-eCApnc jlMQbh\\"><div class=\\"sc-iCoGMd gLxhOh\\"><div class=\\"sc-hKFxyN juinod\\"><h2 class=\\"sc-pNWdM eftmgB\\">petstore_auth</h2><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><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-eEVmNe lmbHgE\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>Security Scheme Type: </b><span>OAuth2</span></div><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>Flow type: </b><code>implicit </code></div><div class=\\"sc-jXcxbT gllWlr\\"><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-jXcxbT gllWlr\\"><b> Scopes: </b></div><div class=\\"sc-fmdNqN eKoRDV container\\" style=\\"height: 4em;\\"><ul><li><code>write:pets</code> - <span class=\\"sc-carFqZ bmTzxo redoc-markdown\\"><p>modify pets in your account</p>
|
||||
</span></li><li><code>read:pets</code> - <span class=\\"sc-carFqZ bmTzxo redoc-markdown\\"><p>read your pets</p>
|
||||
</span></li></ul></div><div class=\\"sc-ljsmAU blhEdv\\"></div></div></div></div></div></div><div id=\\"section/Authentication/GitLab_PersonalAccessToken\\" data-section-id=\\"section/Authentication/GitLab_PersonalAccessToken\\" class=\\"sc-eCApnc jlMQbh\\"><div class=\\"sc-iCoGMd gLxhOh\\"><div class=\\"sc-hKFxyN juinod\\"><h2 class=\\"sc-pNWdM eftmgB\\">GitLab_PersonalAccessToken</h2><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><p>GitLab Personal Access Token description</p>
|
||||
</div><div class=\\"sc-eEVmNe lmbHgE\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>Security Scheme Type: </b><span>API Key</span></div><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><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-eCApnc jlMQbh\\"><div class=\\"sc-iCoGMd gLxhOh\\"><div class=\\"sc-hKFxyN juinod\\"><h2 class=\\"sc-pNWdM eftmgB\\">GitLab_OpenIdConnect</h2><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><p>GitLab OpenIdConnect description</p>
|
||||
</div><div class=\\"sc-eEVmNe lmbHgE\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>Security Scheme Type: </b><span>OpenID Connect</span></div><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><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-eCApnc jlMQbh\\"><div class=\\"sc-iCoGMd gLxhOh\\"><div class=\\"sc-hKFxyN juinod\\"><h2 class=\\"sc-pNWdM eftmgB\\">basicAuth</h2><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"></div><div class=\\"sc-eEVmNe lmbHgE\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>Security Scheme Type: </b><span>HTTP</span></div><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>HTTP Authorization Scheme: </b><code>basic</code></div><div class=\\"sc-jXcxbT gllWlr\\"></div></div></div></div></div></div>"
|
||||
`;
|
||||
|
||||
exports[`SecurityRequirement should render authDefinition 1`] = `"<div class=\\"sc-EZqKI eriJMk\\"><div class=\\"sc-jHcXXw kurgNF\\"><h5 class=\\"sc-iqAclL sc-fXgAZx eONCmm xiVXt\\">Authorizations:</h5><svg class=\\"sc-dIsUp iPqByX\\" 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-bQCEYZ cCwYjG\\"><span class=\\"sc-dWBRfb hoKBYz\\">(<span class=\\"sc-xGAEC bCFTJj\\">API Key: <i>GitLab_PersonalAccessToken</i></span><span class=\\"sc-xGAEC bCFTJj\\">OpenID Connect: <i>GitLab_OpenIdConnect</i></span><span class=\\"sc-xGAEC bCFTJj\\">HTTP: <i>basicAuth</i></span>) </span><span class=\\"sc-dWBRfb hoKBYz\\"><span class=\\"sc-xGAEC bCFTJj\\">OAuth2: <i>petstore_auth</i></span></span></div></div>,"`;
|
||||
|
||||
exports[`SecurityRequirement should render authDefinition 2`] = `
|
||||
"<div class=\\"sc-EZqKI hSmRqE\\"><div class=\\"sc-jHcXXw kurgNF\\"><h5 class=\\"sc-iqAclL sc-fXgAZx eONCmm xiVXt\\">Authorizations:</h5><svg class=\\"sc-dIsUp fVWtGJ\\" 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-bQCEYZ gvMhNy\\"><span class=\\"sc-dWBRfb eLEzSd\\">(<span class=\\"sc-xGAEC bCFTJj\\">API Key: <i>GitLab_PersonalAccessToken</i></span><span class=\\"sc-xGAEC bCFTJj\\">OpenID Connect: <i>GitLab_OpenIdConnect</i></span><span class=\\"sc-xGAEC bCFTJj\\">HTTP: <i>basicAuth</i></span>) </span><span class=\\"sc-dWBRfb eLEzSd\\"><span class=\\"sc-xGAEC bCFTJj\\">OAuth2: <i>petstore_auth</i> (<code class=\\"sc-kYPZxB beMTTe\\">write:pets</code><code class=\\"sc-kYPZxB beMTTe\\">read:pets</code>) </span></span></div></div><div class=\\"sc-eEVmNe lmbHgE\\"><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-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><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-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>Flow type: </b><code>implicit </code></div><div class=\\"sc-jXcxbT gllWlr\\"><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-jXcxbT gllWlr\\"><b> Scopes: </b></div><div class=\\"sc-fmdNqN eKoRDV container\\" style=\\"height: 4em;\\"><ul><li><code>write:pets</code> - <span class=\\"sc-carFqZ bmTzxo redoc-markdown\\"><p>modify pets in your account</p>
|
||||
</span></li><li><code>read:pets</code> - <span class=\\"sc-carFqZ bmTzxo redoc-markdown\\"><p>read your pets</p>
|
||||
</span></li></ul></div><div class=\\"sc-ljsmAU blhEdv\\"></div></div></div><div class=\\"sc-eEVmNe lmbHgE\\"><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-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><p>GitLab Personal Access Token description</p>
|
||||
</div><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>Header parameter name: </b><code>PRIVATE-TOKEN</code></div></div></div><div class=\\"sc-eEVmNe lmbHgE\\"><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-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><p>GitLab OpenIdConnect description</p>
|
||||
</div><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><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-eEVmNe lmbHgE\\"><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-iJCRrE sc-ciSkZP jCdxGr QGruV\\"></div><div class=\\"sc-iJCRrE sc-ciSkZP jCdxGr QGruV\\"><div class=\\"sc-jXcxbT gllWlr\\"><b>HTTP Authorization Scheme: </b><code>basic</code></div><div class=\\"sc-jXcxbT gllWlr\\"></div></div></div>,"
|
||||
`;
|
||||
|
|
|
@ -22,21 +22,14 @@
|
|||
"type": {
|
||||
"type": "string",
|
||||
"description": "The type of response.",
|
||||
"enum": [
|
||||
"TestResponse.Complete"
|
||||
]
|
||||
"enum": ["TestResponse.Complete"]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"FAILURE",
|
||||
"SUCCESS"
|
||||
]
|
||||
"enum": ["FAILURE", "SUCCESS"]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"status"
|
||||
]
|
||||
"required": ["status"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -63,4 +56,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
"schemas": {
|
||||
"Pet": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"type"
|
||||
],
|
||||
"required": ["type"],
|
||||
"discriminator": {
|
||||
"propertyName": "type"
|
||||
},
|
||||
|
|
|
@ -1,116 +1,116 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Models Schema should correct resolve double $ref if no need sibling 1`] = `
|
||||
Object {
|
||||
"refsStack": Array [
|
||||
"#/components/schemas/Parent",
|
||||
],
|
||||
"resolved": Object {
|
||||
"properties": Object {
|
||||
"test": Object {
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
"type": "object",
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Models Schema should hoist oneOfs when mergin allOf 1`] = `
|
||||
Object {
|
||||
"oneOf": Array [
|
||||
Object {
|
||||
"allOf": Array [
|
||||
Object {
|
||||
"properties": Object {
|
||||
"username": Object {
|
||||
"description": "The user's name",
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"properties": Object {
|
||||
"extra": Object {
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"oneOf": Array [
|
||||
Object {
|
||||
"properties": Object {
|
||||
"password": Object {
|
||||
"description": "The user's password",
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"properties": Object {
|
||||
"mobile": Object {
|
||||
"description": "The user's mobile",
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
"x-refsStack": undefined,
|
||||
},
|
||||
Object {
|
||||
"allOf": Array [
|
||||
Object {
|
||||
"properties": Object {
|
||||
"email": Object {
|
||||
"description": "The user's email",
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"properties": Object {
|
||||
"extra": Object {
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"oneOf": Array [
|
||||
Object {
|
||||
"properties": Object {
|
||||
"password": Object {
|
||||
"description": "The user's password",
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"properties": Object {
|
||||
"mobile": Object {
|
||||
"description": "The user's mobile",
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
"x-refsStack": undefined,
|
||||
},
|
||||
],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Models Schema should override description from $ref of the referenced component, when sibling description exists 1`] = `
|
||||
Object {
|
||||
"refsStack": Array [
|
||||
"#/components/schemas/Test",
|
||||
],
|
||||
"resolved": Object {
|
||||
"description": "Overriden description",
|
||||
"type": "object",
|
||||
},
|
||||
}
|
||||
`;
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Models Schema should correct resolve double $ref if no need sibling 1`] = `
|
||||
Object {
|
||||
"refsStack": Array [
|
||||
"#/components/schemas/Parent",
|
||||
],
|
||||
"resolved": Object {
|
||||
"properties": Object {
|
||||
"test": Object {
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
"type": "object",
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Models Schema should hoist oneOfs when mergin allOf 1`] = `
|
||||
Object {
|
||||
"oneOf": Array [
|
||||
Object {
|
||||
"allOf": Array [
|
||||
Object {
|
||||
"properties": Object {
|
||||
"username": Object {
|
||||
"description": "The user's name",
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"properties": Object {
|
||||
"extra": Object {
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"oneOf": Array [
|
||||
Object {
|
||||
"properties": Object {
|
||||
"password": Object {
|
||||
"description": "The user's password",
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"properties": Object {
|
||||
"mobile": Object {
|
||||
"description": "The user's mobile",
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
"x-refsStack": undefined,
|
||||
},
|
||||
Object {
|
||||
"allOf": Array [
|
||||
Object {
|
||||
"properties": Object {
|
||||
"email": Object {
|
||||
"description": "The user's email",
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"properties": Object {
|
||||
"extra": Object {
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"oneOf": Array [
|
||||
Object {
|
||||
"properties": Object {
|
||||
"password": Object {
|
||||
"description": "The user's password",
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"properties": Object {
|
||||
"mobile": Object {
|
||||
"description": "The user's mobile",
|
||||
"type": "string",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
"x-refsStack": undefined,
|
||||
},
|
||||
],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Models Schema should override description from $ref of the referenced component, when sibling description exists 1`] = `
|
||||
Object {
|
||||
"refsStack": Array [
|
||||
"#/components/schemas/Test",
|
||||
],
|
||||
"resolved": Object {
|
||||
"description": "Overriden description",
|
||||
"type": "object",
|
||||
},
|
||||
}
|
||||
`;
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`prism.js helpers highlight js code 1`] = `"<span class=\\"token keyword\\">const</span> t <span class=\\"token operator\\">=</span> <span class=\\"token number\\">10</span><span class=\\"token punctuation\\">;</span>"`;
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`prism.js helpers highlight js code 1`] = `"<span class=\\"token keyword\\">const</span> t <span class=\\"token operator\\">=</span> <span class=\\"token number\\">10</span><span class=\\"token punctuation\\">;</span>"`;
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
"summary": "Get a cat details after update",
|
||||
"description": "Get a cat details after update",
|
||||
"operationId": "updatedCat",
|
||||
"tags": [
|
||||
"pet"
|
||||
],
|
||||
"tags": ["pet"],
|
||||
"requestBody": {
|
||||
"description": "Information about cat in the system",
|
||||
"content": {
|
||||
|
@ -41,9 +39,7 @@
|
|||
"summary": "Create new cat",
|
||||
"description": "Info about new cat",
|
||||
"operationId": "createdCat",
|
||||
"tags": [
|
||||
"pet"
|
||||
],
|
||||
"tags": ["pet"],
|
||||
"requestBody": {
|
||||
"description": "Information about cat in the system",
|
||||
"content": {
|
||||
|
|
|
@ -1,64 +1,57 @@
|
|||
{
|
||||
"openapi": "3.0.0",
|
||||
"info": {
|
||||
"version": "1.0",
|
||||
"title": "Foo"
|
||||
},
|
||||
"components": {
|
||||
"callbacks": {
|
||||
"Test": {
|
||||
"post": {
|
||||
"operationId": "testCallback",
|
||||
"description": "Test callback.",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"title": "TestTitle",
|
||||
"type": "object",
|
||||
"description": "Test description",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "The type of response.",
|
||||
"enum": [
|
||||
"TestResponse.Complete"
|
||||
]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"FAILURE",
|
||||
"SUCCESS"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"status"
|
||||
]
|
||||
"openapi": "3.0.0",
|
||||
"info": {
|
||||
"version": "1.0",
|
||||
"title": "Foo"
|
||||
},
|
||||
"components": {
|
||||
"callbacks": {
|
||||
"Test": {
|
||||
"post": {
|
||||
"operationId": "testCallback",
|
||||
"description": "Test callback.",
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"title": "TestTitle",
|
||||
"type": "object",
|
||||
"description": "Test description",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"description": "The type of response.",
|
||||
"enum": ["TestResponse.Complete"]
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": ["FAILURE", "SUCCESS"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "X-Test-Header",
|
||||
"in": "header",
|
||||
"required": true,
|
||||
"example": "1",
|
||||
"description": "This is a test header parameter",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "Test response."
|
||||
},
|
||||
"required": ["status"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "X-Test-Header",
|
||||
"in": "header",
|
||||
"required": true,
|
||||
"example": "1",
|
||||
"description": "This is a test header parameter",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "Test response."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,9 +28,7 @@
|
|||
"JsonApiResource": {
|
||||
"type": "object",
|
||||
"description": "A related resource.",
|
||||
"required": [
|
||||
"type"
|
||||
],
|
||||
"required": ["type"],
|
||||
"discriminator": {
|
||||
"propertyName": "type"
|
||||
},
|
||||
|
@ -43,9 +41,7 @@
|
|||
},
|
||||
"FooTopLevel": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"data"
|
||||
],
|
||||
"required": ["data"],
|
||||
"properties": {
|
||||
"data": {
|
||||
"$ref": "#/components/schemas/Foo"
|
||||
|
@ -64,4 +60,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,4 +59,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,22 +58,25 @@
|
|||
}
|
||||
},
|
||||
"WithArray": {
|
||||
"oneOf": [{
|
||||
"type" : "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "number"
|
||||
}
|
||||
]
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "number"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
}, {
|
||||
"type": "string"
|
||||
}]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,144 +1,144 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Models Schema schemaDefinition should resolve field with conditional operators 1`] = `
|
||||
Object {
|
||||
"allOf": undefined,
|
||||
"default": undefined,
|
||||
"description": undefined,
|
||||
"items": Object {
|
||||
"allOf": undefined,
|
||||
"description": undefined,
|
||||
"format": "url",
|
||||
"readOnly": undefined,
|
||||
"title": undefined,
|
||||
"type": "string",
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-parentRefs": Array [],
|
||||
},
|
||||
"maxItems": 20,
|
||||
"minItems": 1,
|
||||
"readOnly": undefined,
|
||||
"title": "isString",
|
||||
"type": "string",
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-displayName": "isString",
|
||||
"x-parentRefs": Array [],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Models Schema schemaDefinition should resolve field with conditional operators 2`] = `
|
||||
Object {
|
||||
"allOf": undefined,
|
||||
"default": undefined,
|
||||
"description": undefined,
|
||||
"items": Object {
|
||||
"allOf": undefined,
|
||||
"description": undefined,
|
||||
"format": "url",
|
||||
"readOnly": undefined,
|
||||
"title": undefined,
|
||||
"type": "string",
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-parentRefs": Array [],
|
||||
},
|
||||
"maxItems": 10,
|
||||
"minItems": 1,
|
||||
"pattern": "\\\\d+",
|
||||
"readOnly": undefined,
|
||||
"title": "notString",
|
||||
"type": Array [
|
||||
"string",
|
||||
"integer",
|
||||
"null",
|
||||
],
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-displayName": "notString",
|
||||
"x-parentRefs": Array [],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Models Schema schemaDefinition should resolve schema with conditional operators 1`] = `
|
||||
Object {
|
||||
"allOf": undefined,
|
||||
"description": undefined,
|
||||
"maxItems": 2,
|
||||
"properties": Object {
|
||||
"test": Object {
|
||||
"allOf": undefined,
|
||||
"description": "The list of URL to a cute photos featuring pet",
|
||||
"enum": Array [
|
||||
10,
|
||||
],
|
||||
"items": Object {
|
||||
"allOf": undefined,
|
||||
"description": undefined,
|
||||
"format": "url",
|
||||
"readOnly": undefined,
|
||||
"title": undefined,
|
||||
"type": "string",
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-parentRefs": Array [],
|
||||
},
|
||||
"maxItems": 20,
|
||||
"minItems": 1,
|
||||
"readOnly": undefined,
|
||||
"title": undefined,
|
||||
"type": Array [
|
||||
"string",
|
||||
"integer",
|
||||
"null",
|
||||
],
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-parentRefs": Array [],
|
||||
"x-refsStack": Array [
|
||||
"/oneOf/0",
|
||||
],
|
||||
},
|
||||
},
|
||||
"readOnly": undefined,
|
||||
"title": "=== 10",
|
||||
"type": "object",
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-parentRefs": Array [],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Models Schema schemaDefinition should resolve schema with conditional operators 2`] = `
|
||||
Object {
|
||||
"allOf": undefined,
|
||||
"description": undefined,
|
||||
"maxItems": 20,
|
||||
"properties": Object {
|
||||
"test": Object {
|
||||
"description": "The list of URL to a cute photos featuring pet",
|
||||
"items": Object {
|
||||
"format": "url",
|
||||
"type": "string",
|
||||
},
|
||||
"maxItems": 20,
|
||||
"minItems": 1,
|
||||
"type": Array [
|
||||
"string",
|
||||
"integer",
|
||||
"null",
|
||||
],
|
||||
"x-refsStack": Array [
|
||||
"/oneOf/1",
|
||||
],
|
||||
},
|
||||
},
|
||||
"readOnly": undefined,
|
||||
"title": "case 2",
|
||||
"type": "object",
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-parentRefs": Array [],
|
||||
}
|
||||
`;
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Models Schema schemaDefinition should resolve field with conditional operators 1`] = `
|
||||
Object {
|
||||
"allOf": undefined,
|
||||
"default": undefined,
|
||||
"description": undefined,
|
||||
"items": Object {
|
||||
"allOf": undefined,
|
||||
"description": undefined,
|
||||
"format": "url",
|
||||
"readOnly": undefined,
|
||||
"title": undefined,
|
||||
"type": "string",
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-parentRefs": Array [],
|
||||
},
|
||||
"maxItems": 20,
|
||||
"minItems": 1,
|
||||
"readOnly": undefined,
|
||||
"title": "isString",
|
||||
"type": "string",
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-displayName": "isString",
|
||||
"x-parentRefs": Array [],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Models Schema schemaDefinition should resolve field with conditional operators 2`] = `
|
||||
Object {
|
||||
"allOf": undefined,
|
||||
"default": undefined,
|
||||
"description": undefined,
|
||||
"items": Object {
|
||||
"allOf": undefined,
|
||||
"description": undefined,
|
||||
"format": "url",
|
||||
"readOnly": undefined,
|
||||
"title": undefined,
|
||||
"type": "string",
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-parentRefs": Array [],
|
||||
},
|
||||
"maxItems": 10,
|
||||
"minItems": 1,
|
||||
"pattern": "\\\\d+",
|
||||
"readOnly": undefined,
|
||||
"title": "notString",
|
||||
"type": Array [
|
||||
"string",
|
||||
"integer",
|
||||
"null",
|
||||
],
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-displayName": "notString",
|
||||
"x-parentRefs": Array [],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Models Schema schemaDefinition should resolve schema with conditional operators 1`] = `
|
||||
Object {
|
||||
"allOf": undefined,
|
||||
"description": undefined,
|
||||
"maxItems": 2,
|
||||
"properties": Object {
|
||||
"test": Object {
|
||||
"allOf": undefined,
|
||||
"description": "The list of URL to a cute photos featuring pet",
|
||||
"enum": Array [
|
||||
10,
|
||||
],
|
||||
"items": Object {
|
||||
"allOf": undefined,
|
||||
"description": undefined,
|
||||
"format": "url",
|
||||
"readOnly": undefined,
|
||||
"title": undefined,
|
||||
"type": "string",
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-parentRefs": Array [],
|
||||
},
|
||||
"maxItems": 20,
|
||||
"minItems": 1,
|
||||
"readOnly": undefined,
|
||||
"title": undefined,
|
||||
"type": Array [
|
||||
"string",
|
||||
"integer",
|
||||
"null",
|
||||
],
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-parentRefs": Array [],
|
||||
"x-refsStack": Array [
|
||||
"/oneOf/0",
|
||||
],
|
||||
},
|
||||
},
|
||||
"readOnly": undefined,
|
||||
"title": "=== 10",
|
||||
"type": "object",
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-parentRefs": Array [],
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`Models Schema schemaDefinition should resolve schema with conditional operators 2`] = `
|
||||
Object {
|
||||
"allOf": undefined,
|
||||
"description": undefined,
|
||||
"maxItems": 20,
|
||||
"properties": Object {
|
||||
"test": Object {
|
||||
"description": "The list of URL to a cute photos featuring pet",
|
||||
"items": Object {
|
||||
"format": "url",
|
||||
"type": "string",
|
||||
},
|
||||
"maxItems": 20,
|
||||
"minItems": 1,
|
||||
"type": Array [
|
||||
"string",
|
||||
"integer",
|
||||
"null",
|
||||
],
|
||||
"x-refsStack": Array [
|
||||
"/oneOf/1",
|
||||
],
|
||||
},
|
||||
},
|
||||
"readOnly": undefined,
|
||||
"title": "case 2",
|
||||
"type": "object",
|
||||
"writeOnly": undefined,
|
||||
"x-circular-ref": undefined,
|
||||
"x-parentRefs": Array [],
|
||||
}
|
||||
`;
|
||||
|
|
|
@ -47,6 +47,7 @@ export class FieldModel {
|
|||
name: string;
|
||||
required: boolean;
|
||||
description: string;
|
||||
descriptionClass: string;
|
||||
example?: string;
|
||||
examples?: Record<string, ExampleModel> | any[];
|
||||
deprecated: boolean;
|
||||
|
@ -117,6 +118,8 @@ export class FieldModel {
|
|||
}
|
||||
|
||||
this.const = this.schema?.const || info?.const || '';
|
||||
|
||||
this.descriptionClass = info.descriptionClass || '';
|
||||
}
|
||||
|
||||
@action
|
||||
|
|
|
@ -25,6 +25,7 @@ export class ResponseModel {
|
|||
code: string;
|
||||
summary: string;
|
||||
description: string;
|
||||
descriptionClass?: string;
|
||||
type: string;
|
||||
headers: FieldModel[] = [];
|
||||
extensions: Record<string, any>;
|
||||
|
@ -68,6 +69,8 @@ export class ResponseModel {
|
|||
if (options.showExtensions) {
|
||||
this.extensions = extractExtensions(info, options.showExtensions);
|
||||
}
|
||||
|
||||
this.descriptionClass = info.descriptionClass || '';
|
||||
}
|
||||
|
||||
@action
|
||||
|
|
|
@ -91,6 +91,7 @@ export interface OpenAPIParameter {
|
|||
name: string;
|
||||
in?: OpenAPIParameterLocation;
|
||||
description?: string;
|
||||
descriptionClass?: string;
|
||||
required?: boolean;
|
||||
deprecated?: boolean;
|
||||
allowEmptyValue?: boolean;
|
||||
|
@ -196,6 +197,7 @@ export type OpenAPIParameterStyle =
|
|||
|
||||
export interface OpenAPIRequestBody {
|
||||
description?: string;
|
||||
descriptionClass?: string;
|
||||
required?: boolean;
|
||||
content: { [mime: string]: OpenAPIMediaType };
|
||||
|
||||
|
@ -208,7 +210,10 @@ export interface OpenAPIResponses {
|
|||
}
|
||||
|
||||
export interface OpenAPIResponse
|
||||
extends Pick<OpenAPIRequestBody, 'description' | 'x-examples' | 'x-example'> {
|
||||
extends Pick<
|
||||
OpenAPIRequestBody,
|
||||
'description' | 'descriptionClass' | 'x-examples' | 'x-example'
|
||||
> {
|
||||
headers?: { [name: string]: Referenced<OpenAPIHeader> };
|
||||
links?: { [name: string]: Referenced<OpenAPILink> };
|
||||
content?: { [mime: string]: OpenAPIMediaType };
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user