Skip to content

Introduce forceHttps flag in JsonSchemaFactory.Builder #400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 15, 2021
Merged

Introduce forceHttps flag in JsonSchemaFactory.Builder #400

merged 2 commits into from
Apr 15, 2021

Conversation

hisener
Copy link
Contributor

@hisener hisener commented Apr 14, 2021

In e32a541, schema normalization was introduced to fix #273 however it assumes the given schema is available over HTTPS.

URI newUri = new URI("https", uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(), null, null);

As reported in #314, some schemas are not available over HTTPS. For example, https://iglucentral.com (it just hangs with https), see snowplow/iglu-central#1067.

Therefore #314 blocks snowplow/iglu-scala-client#136 and our internal json-schema-validator dependency upgrade from 1.0.39 to 1.0.40+.

The first commit in this PR provides a failing test for #314 and the second one introduces a boolean flag to control the URI scheme.

Fixes #314.

@codecov-io
Copy link

Codecov Report

Merging #400 (0cc7a78) into master (d907f55) will increase coverage by 0.05%.
The diff coverage is 88.88%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #400      +/-   ##
============================================
+ Coverage     70.76%   70.81%   +0.05%     
- Complexity      750      751       +1     
============================================
  Files            81       81              
  Lines          2894     2899       +5     
  Branches        593      594       +1     
============================================
+ Hits           2048     2053       +5     
  Misses          624      624              
  Partials        222      222              
Impacted Files Coverage Δ Complexity Δ
...n/java/com/networknt/schema/JsonSchemaFactory.java 78.82% <87.50%> (+0.64%) 32.00 <0.00> (+1.00)
...java/com/networknt/schema/SpecVersionDetector.java 92.30% <100.00%> (ø) 6.00 <0.00> (ø)

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 d907f55...0cc7a78. Read the comment docs.

@stevehu
Copy link
Contributor

stevehu commented Apr 15, 2021

@hisener Thanks a lot for your help.

@Stephan202 Stephan202 deleted the hsener/gh-314 branch April 15, 2021 06:40
@hisener
Copy link
Contributor Author

hisener commented May 19, 2021

@stevehu, is there a plan to cut a release soon?

@stevehu
Copy link
Contributor

stevehu commented May 19, 2021

@hisener 1.0.53 has been released a moment ago. Thank you again for your help.

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

@hisener
Copy link
Contributor Author

hisener commented May 19, 2021

Thanks!

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.

Consider not requiring HTTPS for custom meta schemas networknt / json-schema-validator - Unknown Metaschema: http://json-schema.org/draft-07/schema#
3 participants