Skip to content

#258 fixed cyclic dependencies#275

Merged
stevehu merged 2 commits intonetworknt:masterfrom
francesc79:bug/cyclic-dep
Mar 21, 2020
Merged

#258 fixed cyclic dependencies#275
stevehu merged 2 commits intonetworknt:masterfrom
francesc79:bug/cyclic-dep

Conversation

@francesc79
Copy link
Copy Markdown

@stevehu @mihaiba Thi is my solution for resolved the cyclic dependencies

  • Now the JsonSchema class have a initialize method that load the validators from the schima.
  • In the JsonSchemaFactory in the method getSchema from URI I managed a cache. In this case the jsonSchema.initialize is put after the store in the cache for avoid loop.

Please @mihaiba could you check if your case is covered with my solution?

Regards
Francesco

@codecov-io
Copy link
Copy Markdown

codecov-io commented Mar 21, 2020

Codecov Report

Merging #275 into master will increase coverage by 0.32%.
The diff coverage is 93.87%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #275      +/-   ##
============================================
+ Coverage     70.65%   70.97%   +0.32%     
- Complexity      631      634       +3     
============================================
  Files            73       73              
  Lines          2409     2436      +27     
  Branches        511      512       +1     
============================================
+ Hits           1702     1729      +27     
- Misses          503      504       +1     
+ Partials        204      203       -1     
Impacted Files Coverage Δ Complexity Δ
.../java/com/networknt/schema/UnionTypeValidator.java 82.35% <0.00%> (-2.50%) 7.00 <0.00> (ø)
...n/java/com/networknt/schema/JsonSchemaFactory.java 77.77% <91.66%> (+1.23%) 28.00 <1.00> (+1.00)
...etworknt/schema/AdditionalPropertiesValidator.java 91.11% <100.00%> (+0.20%) 16.00 <0.00> (ø)
...main/java/com/networknt/schema/AllOfValidator.java 100.00% <100.00%> (ø) 5.00 <0.00> (ø)
...main/java/com/networknt/schema/AnyOfValidator.java 100.00% <100.00%> (ø) 9.00 <0.00> (ø)
...n/java/com/networknt/schema/ContainsValidator.java 86.36% <100.00%> (+0.64%) 9.00 <0.00> (ø)
...va/com/networknt/schema/DependenciesValidator.java 94.28% <100.00%> (+0.16%) 13.00 <0.00> (ø)
...rc/main/java/com/networknt/schema/IfValidator.java 100.00% <100.00%> (ø) 13.00 <0.00> (ø)
...main/java/com/networknt/schema/ItemsValidator.java 97.67% <100.00%> (+0.17%) 18.00 <0.00> (ø)
src/main/java/com/networknt/schema/JsonSchema.java 87.73% <100.00%> (+0.11%) 43.00 <1.00> (+1.00)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ef94a1...f0a60ef. Read the comment docs.

@francesc79
Copy link
Copy Markdown
Author

@stevehu if you have intention to approve this PR remember to change the url inside CyclicDependencyTest test.

https://raw.githubusercontent.com/francesc79/json-schema-validator/bug/cyclic-dep/src/test/resources/draft4/cyclic/Master.json

@stevehu stevehu merged commit 5bb9b44 into networknt:master Mar 21, 2020
@stevehu
Copy link
Copy Markdown
Contributor

stevehu commented Mar 21, 2020

@francesc79 I did a merge between two PRs above and the final result works for me. Please review and let me know if you have any concerns. Upon your confirmation, I can release a new version. BTW, could you please add a small document for the urnFactory usage? Thanks.

@francesc79
Copy link
Copy Markdown
Author

@stevehu sorry for the late. Today or tomorrow I check and write a documentation about urnFactory

@francesc79
Copy link
Copy Markdown
Author

I opened a new PR for documentation. For this PR also work for me. I confirm you merge.

@stevehu
Copy link
Copy Markdown
Contributor

stevehu commented Mar 22, 2020

@francesc79 Thanks a lot for your contribution. I have released 1.0.36 to the maven central.

https://github.com/networknt/json-schema-validator/releases/tag/1.0.36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants