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

Add virtual structures #92

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 7 (+1) 2219 (+99) 1501 (+71) 264 (+6) 454 (+22) 574 (+20) 53.8K (+2K)
Go (test) 13 (+1) 3015 (+160) 2189 (+117) 307 (+18) 519 (+25) 48 76.3K (+3.9K)
Markdown 4 279 (+63) 225 (+49) 0 54 (+14) 0 12.5K (+1.6K)
github-actions[bot] commented 1 year ago

Go API Changes

# github.com/swaggest/jsonschema-go
## compatible changes
Field: added
Struct: added

# summary
Inferred base version: v0.3.56
Suggested version: v0.4.0
github-actions[bot] commented 1 year ago

Unit Test Coverage

total: (statements) 78.7% changed lines: (statements) 96.3%

Coverage of changed lines | File | Function | Coverage | |----------------|----------------|----------| | Total | | 96.3% | | reflect.go | | 95.7% | | reflect.go:353 | checkTitle | 100.0% | | reflect.go:371 | reflect | 100.0% | | reflect.go:833 | makeFields | 100.0% | | reflect.go:870 | walkProperties | 100.0% | | struct.go | | 100.0% | | struct.go:32 | SetTitle | 100.0% | | struct.go:37 | SetDescription | 100.0% | | struct.go:41 | names | 100.0% |
Coverage diff with base branch | File | Function | Base Coverage | Current Coverage | |----------------------------------------------|----------------|---------------|------------------| | Total | | 78.1% | 78.7% (+0.6%) | | github.com/swaggest/jsonschema-go/reflect.go | checkTitle | no function | 100.0% | | github.com/swaggest/jsonschema-go/reflect.go | makeFields | no function | 100.0% | | github.com/swaggest/jsonschema-go/reflect.go | reflect | 96.6% | 96.7% (+0.1%) | | github.com/swaggest/jsonschema-go/reflect.go | walkProperties | 86.6% | 85.5% (-1.1%) | | github.com/swaggest/jsonschema-go/struct.go | SetDescription | no function | 100.0% | | github.com/swaggest/jsonschema-go/struct.go | SetTitle | no function | 100.0% | | github.com/swaggest/jsonschema-go/struct.go | names | no function | 100.0% |
codecov[bot] commented 1 year ago

Codecov Report

Merging #92 (1101239) into master (7b84a5e) will increase coverage by 0.73%. The diff coverage is 95.23%.

@@            Coverage Diff             @@
##           master      #92      +/-   ##
==========================================
+ Coverage   73.14%   73.88%   +0.73%     
==========================================
  Files           6        7       +1     
  Lines        1132     1164      +32     
==========================================
+ Hits          828      860      +32     
  Misses        237      237              
  Partials       67       67              
Flag Coverage Δ
unittests 73.88% <95.23%> (+0.73%) :arrow_up:

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

Files Changed Coverage Δ
reflect.go 84.07% <94.28%> (+0.68%) :arrow_up:
struct.go 100.00% <100.00%> (ø)

: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 98.4µs ± 3% 100.6µs ± 2% ~ (p=0.093 n=6+6) Schema_UnmarshalJSON-2 747µs ± 1% 791µs ± 3% +5.87% (p=0.002 n=6+6) Schema_MarshalJSON_raw-2 89.3µs ± 2% 95.4µs ± 1% +6.81% (p=0.004 n=6+5) Schema_MarshalJSON-2 294µs ± 0% 305µs ± 4% ~ (p=0.114 n=4+6) name old alloc/op new alloc/op delta Schema_UnmarshalJSON_raw-2 31.7kB ± 0% 31.7kB ± 0% ~ (p=0.147 n=5+6) Schema_UnmarshalJSON-2 184kB ± 0% 184kB ± 0% ~ (p=0.567 n=6+6) Schema_MarshalJSON_raw-2 21.9kB ± 0% 21.9kB ± 0% ~ (p=0.054 n=6+6) Schema_MarshalJSON-2 55.3kB ± 0% 55.3kB ± 0% ~ (p=0.777 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 101µs ± 2% Schema_UnmarshalJSON-2 791µs ± 3% Schema_MarshalJSON_raw-2 95.4µs ± 1% Schema_MarshalJSON-2 305µs ± 4% 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% ```