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

View File

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

View File

@ -497,7 +497,7 @@ export function normalizeServers(
export const SECURITY_DEFINITIONS_COMPONENT_NAME = 'security-definitions';
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 function setSecuritySchemePrefix(prefix: string) {