@@ -841,6 +841,25 @@ const SchemaEdge: React.FC<SchemaEdgeProps> = ({
841841 ) ;
842842} ;
843843
844+ function renderChildren (
845+ schema : SchemaObject ,
846+ schemaType : "request" | "response"
847+ ) {
848+ return (
849+ < >
850+ { schema . oneOf && < AnyOneOf schema = { schema } schemaType = { schemaType } /> }
851+ { schema . anyOf && < AnyOneOf schema = { schema } schemaType = { schemaType } /> }
852+ { schema . properties && (
853+ < Properties schema = { schema } schemaType = { schemaType } />
854+ ) }
855+ { schema . additionalProperties && (
856+ < AdditionalProperties schema = { schema } schemaType = { schemaType } />
857+ ) }
858+ { schema . items && < Items schema = { schema } schemaType = { schemaType } /> }
859+ </ >
860+ ) ;
861+ }
862+
844863const SchemaNode : React . FC < SchemaProps > = ( { schema, schemaType } ) => {
845864 if (
846865 ( schemaType === "request" && schema . readOnly ) ||
@@ -889,10 +908,6 @@ const SchemaNode: React.FC<SchemaProps> = ({ schema, schemaType }) => {
889908 ) ;
890909 }
891910
892- if ( schema . oneOf || schema . anyOf ) {
893- return < AnyOneOf schema = { schema } schemaType = { schemaType } /> ;
894- }
895-
896911 // Handle primitives
897912 if (
898913 schema . type &&
@@ -918,19 +933,7 @@ const SchemaNode: React.FC<SchemaProps> = ({ schema, schemaType }) => {
918933 ) ;
919934 }
920935
921- return (
922- < div >
923- { schema . oneOf && < AnyOneOf schema = { schema } schemaType = { schemaType } /> }
924- { schema . anyOf && < AnyOneOf schema = { schema } schemaType = { schemaType } /> }
925- { schema . properties && (
926- < Properties schema = { schema } schemaType = { schemaType } />
927- ) }
928- { schema . additionalProperties && (
929- < AdditionalProperties schema = { schema } schemaType = { schemaType } />
930- ) }
931- { schema . items && < Items schema = { schema } schemaType = { schemaType } /> }
932- </ div >
933- ) ;
936+ return renderChildren ( schema , schemaType ) ;
934937} ;
935938
936939export default SchemaNode ;
0 commit comments