swaggest / jsonschema-go

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

Propagate values from slices and maps as schema input #75

Closed vearutop closed 1 year ago

github-actions[bot] commented 1 year ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 6 1931 (+19) 1313 (+14) 219 399 (+5) 519 (+11) 46.9K (+358B)
Go (test) 11 2592 (+45) 1859 (+36) 281 (+1) 452 (+8) 45 65.2K (+1K)
github-actions[bot] commented 1 year ago

Unit Test Coverage

total: (statements) 79.1% changed lines: (statements) 91.7%

Coverage of changed lines | File | Function | Coverage | |----------------|------------|----------| | Total | | 91.7% | | reflect.go | | 91.7% | | reflect.go:335 | reflect | 100.0% | | reflect.go:632 | kindSwitch | 90.0% |
Coverage diff with base branch No changes in coverage.
github-actions[bot] commented 1 year ago

Go API Changes

# summary
Inferred base version: v0.3.45
Suggested version: v0.3.46
codecov[bot] commented 1 year ago

Codecov Report

Merging #75 (7cded34) into master (61a8d2a) will increase coverage by 0.48%. The diff coverage is 95.23%.

@@            Coverage Diff             @@
##           master      #75      +/-   ##
==========================================
+ Coverage   72.82%   73.30%   +0.48%     
==========================================
  Files           6        6              
  Lines        1056     1064       +8     
==========================================
+ Hits          769      780      +11     
+ Misses        218      216       -2     
+ Partials       69       68       -1     
Flag Coverage Δ
unittests 73.30% <95.23%> (+0.48%) :arrow_up:

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

Impacted Files Coverage Δ
reflect.go 82.26% <95.00%> (+0.41%) :arrow_up:
context.go 63.46% <100.00%> (+0.71%) :arrow_up:
helper.go 85.84% <0.00%> (+1.88%) :arrow_up:

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

github-actions[bot] commented 1 year ago

Benchmark Result

Benchmark diff with base branch ``` name old time/op new time/op delta Schema_UnmarshalJSON_raw-2 67.6µs ± 1% 69.3µs ± 3% +2.56% (p=0.026 n=6+6) Schema_UnmarshalJSON-2 537µs ± 4% 529µs ± 1% ~ (p=0.537 n=6+5) Schema_MarshalJSON_raw-2 65.0µs ± 4% 63.2µs ± 1% -2.74% (p=0.015 n=6+6) Schema_MarshalJSON-2 210µs ± 1% 209µs ± 1% ~ (p=0.329 n=6+5) name old alloc/op new alloc/op delta Schema_UnmarshalJSON_raw-2 31.7kB ± 0% 31.7kB ± 0% ~ (p=0.797 n=6+6) Schema_UnmarshalJSON-2 184kB ± 0% 184kB ± 0% ~ (p=0.567 n=6+6) Schema_MarshalJSON_raw-2 21.9kB ± 0% 21.9kB ± 0% ~ (all equal) Schema_MarshalJSON-2 55.3kB ± 0% 55.3kB ± 0% ~ (p=0.143 n=6+4) 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 69.3µs ± 3% Schema_UnmarshalJSON-2 529µs ± 1% Schema_MarshalJSON_raw-2 63.2µs ± 1% Schema_MarshalJSON-2 209µs ± 1% 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% ```