go-openapi / spec

openapi specification object model
Apache License 2.0
394 stars 100 forks source link

$ref resolver and expander: canonicalize $ref and basepath #141

Closed fredbi closed 3 years ago

fredbi commented 3 years ago

URL normalization is a key part of the expansion process. Reformulating how URI normalization is carried out is a pre-requisite to properly handle the specifics of file $ref's on windows.

Options handling

Ref normalizer

Tests

Signed-off-by: Frederic BIDON fredbi@yahoo.com

added azure testcase

Signed-off-by: Frederic BIDON fredbi@yahoo.com

codecov[bot] commented 3 years ago

Codecov Report

Merging #141 (8f0170e) into master (eb3c5a0) will increase coverage by 0.76%. The diff coverage is 88.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #141      +/-   ##
==========================================
+ Coverage   62.18%   62.95%   +0.76%     
==========================================
  Files          27       28       +1     
  Lines        2052     2054       +2     
==========================================
+ Hits         1276     1293      +17     
+ Misses        605      592      -13     
+ Partials      171      169       -2     
Impacted Files Coverage Δ
resolver.go 60.00% <14.28%> (+3.13%) :arrow_up:
normalizer_nonwindows.go 62.50% <62.50%> (ø)
schema_loader.go 87.14% <86.20%> (-1.10%) :arrow_down:
normalizer.go 95.58% <95.31%> (+12.00%) :arrow_up:
debug.go 100.00% <100.00%> (ø)
expander.go 81.09% <100.00%> (+2.51%) :arrow_up:

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 eb3c5a0...8f0170e. Read the comment docs.