File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
packages/docusaurus-plugin-openapi-docs/src/markdown Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -783,23 +783,26 @@ export function createNodes(
783783 }
784784
785785 if ( schema . allOf !== undefined ) {
786- if (
787- schema . allOf . length &&
788- typeof schema . allOf [ 0 ] === "string" &&
789- ( schema . allOf [ 0 ] as string ) . includes ( "circular" )
790- ) {
786+ const circularIndex = schema . allOf . findIndex ( ( item : any ) => {
787+ return typeof item === "string" && item . includes ( "circular" ) ;
788+ } ) ;
789+
790+ if ( circularIndex !== - 1 ) {
791791 nodes . push (
792792 create ( "div" , {
793793 style : {
794794 marginTop : ".5rem" ,
795795 marginBottom : ".5rem" ,
796796 marginLeft : "1rem" ,
797797 } ,
798- children : createDescription ( schema . allOf [ 0 ] ) ,
798+ children : createDescription ( schema . allOf [ circularIndex ] as string ) ,
799799 } )
800800 ) ;
801801
802- const rest = schema . allOf . slice ( 1 ) ;
802+ const rest = schema . allOf
803+ . slice ( 0 , circularIndex )
804+ . concat ( schema . allOf . slice ( circularIndex + 1 ) ) ;
805+
803806 if ( rest . length ) {
804807 const mergedSchemas = mergeAllOf ( { allOf : rest } as SchemaObject ) ;
805808 if (
You can’t perform that action at this time.
0 commit comments