-
Notifications
You must be signed in to change notification settings - Fork 340
Cyclic dependencies result in StackOverflowError #258
Copy link
Copy link
Closed
Labels
Description
Having schemaA with property referencing schemaB and schemaB referencing schemaA results in StackOverflowError:
Caused by: com.networknt.schema.JsonSchemaException: java.lang.StackOverflowError
at com.networknt.schema.JsonMetaSchema.newValidator(JsonMetaSchema.java:346)
at com.networknt.schema.ValidationContext.newValidator(ValidationContext.java:50)
at com.networknt.schema.JsonSchema.read(JsonSchema.java:159)
at com.networknt.schema.JsonSchema.<init>(JsonSchema.java:76)
at com.networknt.schema.JsonSchema.<init>(JsonSchema.java:62)
at com.networknt.schema.PropertiesValidator.<init>(PropertiesValidator.java:35)
at sun.reflect.GeneratedConstructorAccessor34.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.networknt.schema.ValidatorTypeCode.newValidator(ValidatorTypeCode.java:128)
at com.networknt.schema.JsonMetaSchema.newValidator(JsonMetaSchema.java:340)
at com.networknt.schema.ValidationContext.newValidator(ValidationContext.java:50)
at com.networknt.schema.JsonSchema.read(JsonSchema.java:159)
at com.networknt.schema.JsonSchema.<init>(JsonSchema.java:76)
at com.networknt.schema.JsonSchema.<init>(JsonSchema.java:62)
at com.networknt.schema.JsonSchema.<init>(JsonSchema.java:57)
at com.networknt.schema.JsonSchemaFactory.newJsonSchema(JsonSchemaFactory.java:253)
at com.networknt.schema.JsonSchemaFactory.getSchema(JsonSchemaFactory.java:330)
Reactions are currently unavailable