@@ -594,6 +594,18 @@ function createEdges({
594
594
required,
595
595
discriminator,
596
596
} : EdgeProps ) : any {
597
+ if ( SCHEMA_TYPE === "request" ) {
598
+ if ( schema . readOnly && schema . readOnly === true ) {
599
+ return undefined ;
600
+ }
601
+ }
602
+
603
+ if ( SCHEMA_TYPE === "response" ) {
604
+ if ( schema . writeOnly && schema . writeOnly === true ) {
605
+ return undefined ;
606
+ }
607
+ }
608
+
597
609
const schemaName = getSchemaName ( schema ) ;
598
610
if ( discriminator !== undefined && discriminator . propertyName === name ) {
599
611
return createPropertyDiscriminator (
@@ -619,6 +631,19 @@ function createEdges({
619
631
const { mergedSchemas } : { mergedSchemas : SchemaObject } = mergeAllOf (
620
632
schema . allOf
621
633
) ;
634
+
635
+ if ( SCHEMA_TYPE === "request" ) {
636
+ if ( mergedSchemas . readOnly && mergedSchemas . readOnly === true ) {
637
+ return undefined ;
638
+ }
639
+ }
640
+
641
+ if ( SCHEMA_TYPE === "response" ) {
642
+ if ( mergedSchemas . writeOnly && mergedSchemas . writeOnly === true ) {
643
+ return undefined ;
644
+ }
645
+ }
646
+
622
647
const mergedSchemaName = getSchemaName ( mergedSchemas ) ;
623
648
if (
624
649
mergedSchemas . oneOf !== undefined ||
@@ -664,18 +689,6 @@ function createEdges({
664
689
) ;
665
690
}
666
691
667
- if ( SCHEMA_TYPE === "request" ) {
668
- if ( mergedSchemas . readOnly && mergedSchemas . readOnly === true ) {
669
- return undefined ;
670
- }
671
- }
672
-
673
- if ( SCHEMA_TYPE === "response" ) {
674
- if ( mergedSchemas . writeOnly && mergedSchemas . writeOnly === true ) {
675
- return undefined ;
676
- }
677
- }
678
-
679
692
return create ( "SchemaItem" , {
680
693
collapsible : false ,
681
694
name,
@@ -727,18 +740,6 @@ function createEdges({
727
740
) ;
728
741
}
729
742
730
- if ( SCHEMA_TYPE === "request" ) {
731
- if ( schema . readOnly && schema . readOnly === true ) {
732
- return undefined ;
733
- }
734
- }
735
-
736
- if ( SCHEMA_TYPE === "response" ) {
737
- if ( schema . writeOnly && schema . writeOnly === true ) {
738
- return undefined ;
739
- }
740
- }
741
-
742
743
// primitives and array of non-objects
743
744
return create ( "SchemaItem" , {
744
745
collapsible : false ,
@@ -758,6 +759,17 @@ export function createNodes(
758
759
schemaType : "request" | "response"
759
760
) : any {
760
761
SCHEMA_TYPE = schemaType ;
762
+ if ( SCHEMA_TYPE === "request" ) {
763
+ if ( schema . readOnly && schema . readOnly === true ) {
764
+ return undefined ;
765
+ }
766
+ }
767
+
768
+ if ( SCHEMA_TYPE === "response" ) {
769
+ if ( schema . writeOnly && schema . writeOnly === true ) {
770
+ return undefined ;
771
+ }
772
+ }
761
773
const nodes = [ ] ;
762
774
// if (schema.discriminator !== undefined) {
763
775
// return createDiscriminator(schema);
0 commit comments