diff --git a/packages/docusaurus-plugin-openapi-docs/src/markdown/createSchema.ts b/packages/docusaurus-plugin-openapi-docs/src/markdown/createSchema.ts index 6cd888885..15767905f 100644 --- a/packages/docusaurus-plugin-openapi-docs/src/markdown/createSchema.ts +++ b/packages/docusaurus-plugin-openapi-docs/src/markdown/createSchema.ts @@ -624,7 +624,6 @@ function createEdges({ }: { mergedSchemas: SchemaObject; required: string[] | boolean } = mergeAllOf(schema.allOf); const mergedSchemaName = getSchemaName(mergedSchemas); - if ( mergedSchemas.oneOf !== undefined || mergedSchemas.anyOf !== undefined @@ -685,8 +684,8 @@ function createEdges({ collapsible: false, name, required: Array.isArray(required) ? required.includes(name) : required, - schemaName: schemaName, - qualifierMessage: getQualifierMessage(schema), + schemaName: mergedSchemaName, + qualifierMessage: getQualifierMessage(mergedSchemas), schema: mergedSchemas, }); } diff --git a/packages/docusaurus-plugin-openapi-docs/src/markdown/schema.ts b/packages/docusaurus-plugin-openapi-docs/src/markdown/schema.ts index be09c11cd..5ac9c92b9 100644 --- a/packages/docusaurus-plugin-openapi-docs/src/markdown/schema.ts +++ b/packages/docusaurus-plugin-openapi-docs/src/markdown/schema.ts @@ -40,6 +40,10 @@ function prettyName(schema: SchemaObject, circular?: boolean) { // return schema.type; } + if (schema.title && schema.type) { + return `${schema.title} (${schema.type})`; + } + return schema.title ?? schema.type; }