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 support for subschema exposers #32

Closed vearutop closed 2 years ago

github-actions[bot] commented 2 years ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 6 1544 (+139) 1087 (+95) 132 (+7) 325 (+37) 431 (+26) 35.6K (+3.1K)
Go (test) 11 (+1) 1780 (+155) 1302 (+114) 213 (+18) 265 (+23) 43 (+4) 45.7K (+3.7K)
Markdown 1 101 (+9) 81 (+8) 0 20 (+1) 0 5.4K (+954B)
github-actions[bot] commented 2 years ago

Unit Test Coverage

total: (statements) 74.5%

Coverage diff with base branch ```diff 66c66 < github.com/swaggest/jsonschema-go/entities.go WithIf 0.0% --- > github.com/swaggest/jsonschema-go/entities.go WithIf 100.0% 68c68 < github.com/swaggest/jsonschema-go/entities.go WithThen 0.0% --- > github.com/swaggest/jsonschema-go/entities.go WithThen 100.0% 70c70 < github.com/swaggest/jsonschema-go/entities.go WithElse 0.0% --- > github.com/swaggest/jsonschema-go/entities.go WithElse 100.0% 75c75 < github.com/swaggest/jsonschema-go/entities.go WithNot 0.0% --- > github.com/swaggest/jsonschema-go/entities.go WithNot 100.0% 123c123,124 < github.com/swaggest/jsonschema-go/reflect.go reflect 94.5% --- > github.com/swaggest/jsonschema-go/reflect.go reflect 92.9% > github.com/swaggest/jsonschema-go/reflect.go applySubSchemas 86.8% 135c136 < total: (statements) 72.8% --- > total: (statements) 74.5% ```
github-actions[bot] commented 2 years ago

Go API Changes

# github.com/swaggest/jsonschema-go
## compatible changes
AllOfExposer: added
AnyOfExposer: added
ElseExposer: added
ErrSkipProperty: added
IfExposer: added
NotExposer: added
OneOfExposer: added
StripDefinitionNamePrefix: added
ThenExposer: added

# summary
Inferred base version: v0.3.24
Suggested version: v0.4.0
codecov[bot] commented 2 years ago

Codecov Report

Merging #32 (c66b952) into master (21e54e7) will increase coverage by 0.91%. The diff coverage is 67.92%.

@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
+ Coverage   67.22%   68.14%   +0.91%     
==========================================
  Files           6        6              
  Lines         897      948      +51     
==========================================
+ Hits          603      646      +43     
  Misses        234      234              
- Partials       60       68       +8     
Flag Coverage Δ
unittests 68.14% <67.92%> (+0.91%) :arrow_up:

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

Impacted Files Coverage Δ
helper.go 82.41% <ø> (ø)
reflect.go 74.61% <67.92%> (-0.76%) :arrow_down:
entities.go 53.65% <0.00%> (+2.43%) :arrow_up:

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

github-actions[bot] commented 2 years ago

Benchmark Result

Benchmark diff with base branch ``` name old time/op new time/op delta Schema_UnmarshalJSON_raw-2 76.3µs ± 3% 76.0µs ± 2% ~ (p=1.000 n=5+5) Schema_UnmarshalJSON-2 590µs ± 3% 595µs ± 7% ~ (p=0.841 n=5+5) Schema_MarshalJSON_raw-2 74.0µs ± 2% 77.2µs ± 4% ~ (p=0.056 n=5+5) Schema_MarshalJSON-2 225µs ± 2% 227µs ± 2% ~ (p=0.421 n=5+5) name old alloc/op new alloc/op delta Schema_UnmarshalJSON_raw-2 31.7kB ± 0% 31.7kB ± 0% ~ (p=0.333 n=5+5) Schema_UnmarshalJSON-2 180kB ± 0% 180kB ± 0% ~ (p=0.556 n=5+4) Schema_MarshalJSON_raw-2 30.9kB ± 0% 30.9kB ± 0% ~ (p=0.206 n=5+5) Schema_MarshalJSON-2 53.9kB ± 0% 53.9kB ± 0% ~ (p=0.571 n=5+5) 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 554 ± 0% 554 ± 0% ~ (all equal) Schema_MarshalJSON-2 482 ± 0% 482 ± 0% ~ (all equal) ```
Benchmark result ``` name time/op Schema_UnmarshalJSON_raw-2 76.0µs ± 2% Schema_UnmarshalJSON-2 595µs ± 7% Schema_MarshalJSON_raw-2 77.2µs ± 4% Schema_MarshalJSON-2 227µs ± 2% name alloc/op Schema_UnmarshalJSON_raw-2 31.7kB ± 0% Schema_UnmarshalJSON-2 180kB ± 0% Schema_MarshalJSON_raw-2 30.9kB ± 0% Schema_MarshalJSON-2 53.9kB ± 0% name allocs/op Schema_UnmarshalJSON_raw-2 457 ± 0% Schema_UnmarshalJSON-2 2.00k ± 0% Schema_MarshalJSON_raw-2 554 ± 0% Schema_MarshalJSON-2 482 ± 0% ```