{"action":"closed","issue":{"url":"https://api.github.com/repos/everit-org/json-schema/issues/17","labels_url":"https://api.github.com/repos/everit-org/json-schema/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/everit-org/json-schema/issues/17/comments","events_url":"https://api.github.com/repos/everit-org/json-schema/issues/17/events","html_url":"https://github.com/everit-org/json-schema/issues/17","id":122487964,"number":17,"title":"StackOverflowError on combined schemas","user":{"login":"ujibang","id":6876503,"avatar_url":"https://avatars.githubusercontent.com/u/6876503?v=3","gravatar_id":"","url":"https://api.github.com/users/ujibang","html_url":"https://github.com/ujibang","followers_url":"https://api.github.com/users/ujibang/followers","following_url":"https://api.github.com/users/ujibang/following{/other_user}","gists_url":"https://api.github.com/users/ujibang/gists{/gist_id}","starred_url":"https://api.github.com/users/ujibang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ujibang/subscriptions","organizations_url":"https://api.github.com/users/ujibang/orgs","repos_url":"https://api.github.com/users/ujibang/repos","events_url":"https://api.github.com/users/ujibang/events{/privacy}","received_events_url":"https://api.github.com/users/ujibang/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2015-12-16T11:53:38Z","updated_at":"2016-01-12T11:03:40Z","closed_at":"2016-01-12T11:03:40Z","body":"I have defined two schemas. One extends the other using *allOf* and *$ref*\r\n\r\nWhen I try to validate a json document I get StackOverflowError exception.\r\n\r\nI have done some debugging and even if I pass the *child* schema to the SchemaLoader.load() method, the SchemaClient seems loads *child* again via http. I think it should load *parent* instead.\r\n\r\nTest document passed to validate:\r\n```\r\n{n:1, s: \"test\" }\r\n```\r\n\r\n**parent schema**\r\n```\r\n{\r\n  \"_$schema\":\"http://json-schema.org/draft-04/schema#\"\r\n  \"id\":\"http://127.0.0.1:8080/test/_schemas/parent#\",\r\n  \"type\":\"object\",\r\n  \"properties\":{ \"n\":{ \"type\":\"number\" } },\r\n  \"required\":[ \"n\" ]\r\n}\r\n```\r\n\r\n**child schema**\r\n```\r\n{\r\n  \"_$schema\":\"http://json-schema.org/draft-04/schema#\",\r\n  \"id\":\"http://127.0.0.1:8080/test/_schemas/child#\",\r\n  \"allOf\":[ \r\n    { \"_$ref\":\"parent\" },\r\n    {\r\n      \"_$schema\":\"http://json-schema.org/draft-04/schema#\",\r\n      \"required\":[ \"s\" ],\r\n      \"type\":\"object\",\r\n      \"properties\":{ \"s\":{ \"type\":\"string\" } }\r\n    }\r\n  ],\r\n  \"additionalProperties\":false\r\n}\r\n```\r\n\r\n**Exception**\r\n\r\n```\r\njava.lang.StackOverflowError: null\r\n\tat org.everit.json.schema.CombinedSchema.succeeds(CombinedSchema.java:155) ~[org.everit.json.schema-1.1.0.jar:na]\r\n\tat org.everit.json.schema.CombinedSchema.lambda$validate$9(CombinedSchema.java:165) ~[org.everit.json.schema-1.1.0.jar:na]\r\n\tat org.everit.json.schema.CombinedSchema$$Lambda$90/207956499.test(Unknown Source) ~[na:na]\r\n\tat java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) ~[na:1.8.0]\r\n\tat java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[na:1.8.0]\r\n\tat java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512) ~[na:1.8.0]\r\n\tat java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502) ~[na:1.8.0]\r\n\tat java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[na:1.8.0]\r\n\tat java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:1.8.0]\r\n\tat java.util.stream.LongPipeline.reduce(LongPipeline.java:438) ~[na:1.8.0]\r\n\tat java.util.stream.LongPipeline.sum(LongPipeline.java:396) ~[na:1.8.0]\r\n\tat java.util.stream.ReferencePipeline.count(ReferencePipeline.java:526) ~[na:1.8.0]\r\n\tat org.everit.json.schema.CombinedSchema.validate(CombinedSchema.java:166) ~[org.everit.json.schema-1.1.0.jar:na]\r\n\tat org.everit.json.schema.ReferenceSchema.validate(ReferenceSchema.java:61) ~[org.everit.json.schema-1.1.0.jar:na]\r\n\tat org.everit.json.schema.CombinedSchema.succeeds(CombinedSchema.java:155) ~[org.everit.json.schema-1.1.0.jar:na]\r\n\tat org.everit.json.schema.CombinedSchema.lambda$validate$9(CombinedSchema.java:165) ~[org.everit.json.schema-1.1.0.jar:na]\r\n\tat org.everit.json.schema.CombinedSchema$$Lambda$90/207956499.test(Unknown Source) ~[na:na]\r\n...\r\n```"}}