Skip to content

Commit

Permalink
chore: do not override theme.openapi with ConfigReferenceDocs node type
Browse files Browse the repository at this point in the history
  • Loading branch information
tatomyr committed May 30, 2024
1 parent 1e55057 commit fd30e15
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions packages/core/src/types/redocly-yaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ const createConfigRoot = (nodeTypes: Record<string, NodeType>): NodeType => ({
...nodeTypes.rootRedoclyConfigSchema.properties,
...ConfigStyleguide.properties,
apis: 'ConfigApis', // Override apis with internal format
theme: 'ConfigRootTheme', // Override theme with internal format
'features.openapi': 'ConfigReferenceDocs', // deprecated
'features.mockServer': 'ConfigMockServer', // deprecated
organization: { type: 'string' },
Expand Down Expand Up @@ -315,14 +314,6 @@ const ConfigHTTP: NodeType = {
},
};

const createConfigRootTheme = (nodeTypes: Record<string, NodeType>): NodeType => ({
...nodeTypes['rootRedoclyConfigSchema.theme'],
properties: {
...nodeTypes['rootRedoclyConfigSchema.theme']?.properties,
openapi: 'ConfigReferenceDocs', // Override theme.openapi with internal format
},
});

const Rules: NodeType = {
properties: {},
additionalProperties: (value: unknown, key: string) => {
Expand Down Expand Up @@ -932,10 +923,10 @@ const GenerateCodeSamples: NodeType = {
required: ['languages'],
};

// TODO: deprecated
const ConfigReferenceDocs: NodeType = {
// TODO: partially invalid @Viacheslav
properties: {
theme: 'ConfigTheme', // TODO: deprecated @Viacheslav
theme: 'ConfigTheme',
corsProxyUrl: { type: 'string' },
ctrlFHijack: { type: 'boolean' },
defaultSampleLanguage: { type: 'string' },
Expand Down Expand Up @@ -1072,9 +1063,8 @@ export const createConfigTypes = (extraSchemas: JSONSchema) => {

return {
...CoreConfigTypes,
ConfigRoot: createConfigRoot(nodeTypes),
ConfigRoot: createConfigRoot(nodeTypes), // This is the REAL config root type
ConfigApisProperties: createConfigApisProperties(nodeTypes),
ConfigRootTheme: createConfigRootTheme(nodeTypes),
...nodeTypes,
};
};
Expand Down

0 comments on commit fd30e15

Please sign in to comment.