mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-07 13:44:54 +03:00
feat: add contentMediaType and contentEncoding
This commit is contained in:
parent
79ca769f32
commit
ba3b2c52e4
|
@ -1166,6 +1166,11 @@ components:
|
|||
description: User status
|
||||
type: integer
|
||||
format: int32
|
||||
image:
|
||||
description: User image
|
||||
type: string
|
||||
contentEncoding: base64
|
||||
contentMediaType: image/png
|
||||
xml:
|
||||
name: User
|
||||
requestBodies:
|
||||
|
|
|
@ -76,6 +76,20 @@ export class FieldDetails extends React.PureComponent<FieldProps, { patternShown
|
|||
>{' '}
|
||||
</TypeFormat>
|
||||
)}
|
||||
{schema.contentEncoding && (
|
||||
<TypeFormat>
|
||||
{' '}<
|
||||
{schema.contentEncoding}
|
||||
>{' '}
|
||||
</TypeFormat>
|
||||
)}
|
||||
{schema.contentMediaType && (
|
||||
<TypeFormat>
|
||||
{' '}<
|
||||
{schema.contentMediaType}
|
||||
>{' '}
|
||||
</TypeFormat>
|
||||
)}
|
||||
{schema.title && !hideSchemaTitles && <TypeTitle> ({schema.title}) </TypeTitle>}
|
||||
<ConstraintsView constraints={schema.constraints} />
|
||||
{schema.pattern && !hideSchemaPattern && (
|
||||
|
|
|
@ -61,6 +61,8 @@ export class SchemaModel {
|
|||
schema: MergedOpenAPISchema;
|
||||
extensions?: Record<string, any>;
|
||||
const: any;
|
||||
contentEncoding?: string;
|
||||
contentMediaType?: string;
|
||||
|
||||
/**
|
||||
* @param isChild if schema discriminator Child
|
||||
|
@ -120,6 +122,8 @@ export class SchemaModel {
|
|||
this.readOnly = !!schema.readOnly;
|
||||
this.writeOnly = !!schema.writeOnly;
|
||||
this.const = schema.const || '';
|
||||
this.contentEncoding = schema.contentEncoding;
|
||||
this.contentMediaType = schema.contentMediaType;
|
||||
|
||||
if (!!schema.nullable) {
|
||||
if (Array.isArray(this.type) && !this.type.includes('null')) {
|
||||
|
|
|
@ -147,6 +147,8 @@ export interface OpenAPISchema {
|
|||
enum?: any[];
|
||||
example?: any;
|
||||
const?: string;
|
||||
contentEncoding?: string;
|
||||
contentMediaType?: string;
|
||||
}
|
||||
|
||||
export interface OpenAPIDiscriminator {
|
||||
|
|
|
@ -83,6 +83,8 @@ const schemaKeywordTypes = {
|
|||
maxLength: 'string',
|
||||
minLength: 'string',
|
||||
pattern: 'string',
|
||||
contentEncoding: 'string',
|
||||
contentMediaType: 'string',
|
||||
|
||||
items: 'array',
|
||||
maxItems: 'array',
|
||||
|
|
Loading…
Reference in New Issue
Block a user