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(
783
783
}
784
784
785
785
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 ) {
791
791
nodes . push (
792
792
create ( "div" , {
793
793
style : {
794
794
marginTop : ".5rem" ,
795
795
marginBottom : ".5rem" ,
796
796
marginLeft : "1rem" ,
797
797
} ,
798
- children : createDescription ( schema . allOf [ 0 ] ) ,
798
+ children : createDescription ( schema . allOf [ circularIndex ] as string ) ,
799
799
} )
800
800
) ;
801
801
802
- const rest = schema . allOf . slice ( 1 ) ;
802
+ const rest = schema . allOf
803
+ . slice ( 0 , circularIndex )
804
+ . concat ( schema . allOf . slice ( circularIndex + 1 ) ) ;
805
+
803
806
if ( rest . length ) {
804
807
const mergedSchemas = mergeAllOf ( { allOf : rest } as SchemaObject ) ;
805
808
if (
You can’t perform that action at this time.
0 commit comments