chore: rename ObjectDescription to SchemaDefinition

This commit is contained in:
Roman Hotsiy 2019-07-29 17:14:32 +03:00
parent 0504ad4b76
commit 9bf45d810e
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
3 changed files with 7 additions and 7 deletions

View File

@ -18,7 +18,7 @@ export interface ObjectDescriptionProps {
options: RedocNormalizedOptions; options: RedocNormalizedOptions;
} }
export class ObjectDescription extends React.PureComponent<ObjectDescriptionProps> { export class SchemaDefinition extends React.PureComponent<ObjectDescriptionProps> {
private static getMediaType(schemaRef: string, exampleRef?: string): OpenAPIMediaType { private static getMediaType(schemaRef: string, exampleRef?: string): OpenAPIMediaType {
if (!schemaRef) { if (!schemaRef) {
return {}; return {};
@ -44,7 +44,7 @@ export class ObjectDescription extends React.PureComponent<ObjectDescriptionProp
parser, parser,
'json', 'json',
false, false,
ObjectDescription.getMediaType(schemaRef, exampleRef), SchemaDefinition.getMediaType(schemaRef, exampleRef),
options, options,
); );
} }

View File

@ -10,10 +10,10 @@ import { RedocNormalizedOptions, RedocRawOptions } from './RedocNormalizedOption
import { ScrollService } from './ScrollService'; import { ScrollService } from './ScrollService';
import { SearchStore } from './SearchStore'; import { SearchStore } from './SearchStore';
import { ObjectDescription } from '../components/ObjectDescription/ObjectDescription'; import { SchemaDefinition } from '../components/SchemaDefinition/SchemaDefinition';
import { SecurityDefs } from '../components/SecuritySchemes/SecuritySchemes'; import { SecurityDefs } from '../components/SecuritySchemes/SecuritySchemes';
import { import {
OBJECT_DEFINTION_JSX_NAME, SCHEMA_DEFINITION_JSX_NAME,
SECURITY_DEFINITIONS_COMPONENT_NAME, SECURITY_DEFINITIONS_COMPONENT_NAME,
SECURITY_DEFINITIONS_JSX_NAME, SECURITY_DEFINITIONS_JSX_NAME,
} from '../utils/openapi'; } from '../utils/openapi';
@ -162,8 +162,8 @@ const DEFAULT_OPTIONS: RedocRawOptions = {
securitySchemes: store.spec.securitySchemes, securitySchemes: store.spec.securitySchemes,
}), }),
}, },
[OBJECT_DEFINTION_JSX_NAME]: { [SCHEMA_DEFINITION_JSX_NAME]: {
component: ObjectDescription, component: SchemaDefinition,
propsSelector: (store: AppStore) => ({ propsSelector: (store: AppStore) => ({
parser: store.spec.parser, parser: store.spec.parser,
options: store.options, options: store.options,

View File

@ -497,7 +497,7 @@ export function normalizeServers(
export const SECURITY_DEFINITIONS_COMPONENT_NAME = 'security-definitions'; export const SECURITY_DEFINITIONS_COMPONENT_NAME = 'security-definitions';
export const SECURITY_DEFINITIONS_JSX_NAME = 'SecurityDefinitions'; export const SECURITY_DEFINITIONS_JSX_NAME = 'SecurityDefinitions';
export const OBJECT_DEFINTION_JSX_NAME = 'ObjectDescription'; export const SCHEMA_DEFINITION_JSX_NAME = 'ObjectDescription';
export let SECURITY_SCHEMES_SECTION_PREFIX = 'section/Authentication/'; export let SECURITY_SCHEMES_SECTION_PREFIX = 'section/Authentication/';
export function setSecuritySchemePrefix(prefix: string) { export function setSecuritySchemePrefix(prefix: string) {