swaggest / jsonschema-go

JSON Schema mapping for Go
https://pkg.go.dev/github.com/swaggest/jsonschema-go
MIT License
102 stars 13 forks source link

Fix duplicate references inlining #88

Closed vearutop closed 11 months ago

vearutop commented 11 months ago

Fixes #87.

github-actions[bot] commented 11 months ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 6 2100 1417 254 429 548 (+1) 51.2K (+18B)
Go (test) 12 2818 (+38) 2042 (+33) 289 487 (+5) 48 71.7K (+917B)
github-actions[bot] commented 11 months ago

Go API Changes

# summary
Inferred base version: v0.3.52
Suggested version: v0.4.0
github-actions[bot] commented 11 months ago

Unit Test Coverage

total: (statements) 78.3% changed lines: (statements) 100.0%

Coverage of changed lines | File | Function | Coverage | |----------------|----------|----------| | Total | | 100.0% | | reflect.go | | 100.0% | | reflect.go:352 | reflect | 100.0% |
Coverage diff with base branch | File | Function | Base Coverage | Current Coverage | |----------------------------------------------|--------------|---------------|------------------| | Total | | 78.1% | 78.3% (+0.2%) | | github.com/swaggest/jsonschema-go/context.go | InlineRefs | 0.0% | 100.0% (+100.0%) | | github.com/swaggest/jsonschema-go/reflect.go | reflectDefer | 96.4% | 100.0% (+3.6%) |
codecov[bot] commented 11 months ago

Codecov Report

Merging #88 (ceabab9) into master (34675e7) will increase coverage by 0.26%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #88      +/-   ##
==========================================
+ Coverage   72.95%   73.22%   +0.26%     
==========================================
  Files           6        6              
  Lines        1124     1124              
==========================================
+ Hits          820      823       +3     
+ Misses        235      233       -2     
+ Partials       69       68       -1     
Flag Coverage Δ
unittests 73.22% <100.00%> (+0.26%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
reflect.go 83.04% <100.00%> (+0.34%) :arrow_up:

... and 1 file with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

github-actions[bot] commented 11 months ago

Benchmark Result

Benchmark diff with base branch ``` name old time/op new time/op delta Schema_UnmarshalJSON_raw-2 75.5µs ± 1% 75.6µs ± 1% ~ (p=0.662 n=6+5) Schema_UnmarshalJSON-2 597µs ± 0% 600µs ± 0% +0.42% (p=0.017 n=6+5) Schema_MarshalJSON_raw-2 71.0µs ± 1% 71.1µs ± 1% ~ (p=1.000 n=6+6) Schema_MarshalJSON-2 244µs ± 1% 245µs ± 0% ~ (p=0.394 n=6+6) name old alloc/op new alloc/op delta Schema_UnmarshalJSON_raw-2 31.7kB ± 0% 31.7kB ± 0% ~ (p=0.400 n=6+6) Schema_UnmarshalJSON-2 184kB ± 0% 184kB ± 0% ~ (all equal) Schema_MarshalJSON_raw-2 21.9kB ± 0% 21.9kB ± 0% ~ (all equal) Schema_MarshalJSON-2 55.3kB ± 0% 55.3kB ± 0% ~ (p=0.056 n=6+6) name old allocs/op new allocs/op delta Schema_UnmarshalJSON_raw-2 457 ± 0% 457 ± 0% ~ (all equal) Schema_UnmarshalJSON-2 2.00k ± 0% 2.00k ± 0% ~ (all equal) Schema_MarshalJSON_raw-2 484 ± 0% 484 ± 0% ~ (all equal) Schema_MarshalJSON-2 477 ± 0% 477 ± 0% ~ (all equal) ```
Benchmark result ``` name time/op Schema_UnmarshalJSON_raw-2 75.6µs ± 1% Schema_UnmarshalJSON-2 600µs ± 0% Schema_MarshalJSON_raw-2 71.1µs ± 1% Schema_MarshalJSON-2 245µs ± 0% name alloc/op Schema_UnmarshalJSON_raw-2 31.7kB ± 0% Schema_UnmarshalJSON-2 184kB ± 0% Schema_MarshalJSON_raw-2 21.9kB ± 0% Schema_MarshalJSON-2 55.3kB ± 0% name allocs/op Schema_UnmarshalJSON_raw-2 457 ± 0% Schema_UnmarshalJSON-2 2.00k ± 0% Schema_MarshalJSON_raw-2 484 ± 0% Schema_MarshalJSON-2 477 ± 0% ```