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

Improve text marshaler checks #44

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 1707 (+11) 1179 (+7) 170 (+1) 358 (+3) 458 (+8) 40.5K (+523B)
Go (test) 11 2128 (+78) 1567 (+62) 226 335 (+16) 43 54.7K (+1.8K)
YAML 6 440 (+1) 376 (+1) 36 28 0 14.3K (+18B)
github-actions[bot] commented 2 years ago

Go API Changes

# github.com/swaggest/jsonschema-go
## compatible changes
ReflectContext.SkipNonConstraints: added

# summary
Inferred base version: v0.3.34
Suggested version: v0.4.0
github-actions[bot] commented 2 years ago

Unit Test Coverage

total: (statements) 76.9%

Coverage diff with base branch ```diff 126c126 < github.com/swaggest/jsonschema-go/reflect.go isWellKnownType 83.3% --- > github.com/swaggest/jsonschema-go/reflect.go isWellKnownType 100.0% 128c128 < github.com/swaggest/jsonschema-go/reflect.go kindSwitch 89.7% --- > github.com/swaggest/jsonschema-go/reflect.go kindSwitch 87.2% 131,132c131,132 < github.com/swaggest/jsonschema-go/reflect.go walkProperties 84.6% < github.com/swaggest/jsonschema-go/reflect.go checkInlineValue 80.8% --- > github.com/swaggest/jsonschema-go/reflect.go walkProperties 85.0% > github.com/swaggest/jsonschema-go/reflect.go checkInlineValue 80.0% 134c134 < github.com/swaggest/jsonschema-go/reflect.go reflectExample 82.8% --- > github.com/swaggest/jsonschema-go/reflect.go reflectExample 82.1% 149c149 < total: (statements) 76.8% --- > total: (statements) 76.9% ```
codecov[bot] commented 2 years ago

Codecov Report

Merging #44 (64a895a) into master (b824c35) will decrease coverage by 2.37%. The diff coverage is 60.00%.

@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
- Coverage   70.71%   68.34%   -2.38%     
==========================================
  Files           6        6              
  Lines         987      733     -254     
==========================================
- Hits          698      501     -197     
+ Misses        221      183      -38     
+ Partials       68       49      -19     
Flag Coverage Δ
unittests 68.34% <60.00%> (-2.38%) :arrow_down:

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

Impacted Files Coverage Δ
context.go 65.00% <ø> (-1.67%) :arrow_down:
reflect.go 81.06% <60.00%> (+1.87%) :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 91.4µs ± 2% 90.9µs ± 3% ~ (p=0.690 n=5+5) Schema_UnmarshalJSON-2 723µs ± 2% 736µs ± 8% ~ (p=0.151 n=5+5) Schema_MarshalJSON_raw-2 89.2µs ± 1% 91.9µs ± 5% ~ (p=0.690 n=5+5) Schema_MarshalJSON-2 272µs ± 2% 279µs ± 3% ~ (p=0.095 n=5+5) name old alloc/op new alloc/op delta Schema_UnmarshalJSON_raw-2 31.7kB ± 0% 31.7kB ± 0% ~ (p=0.651 n=5+5) Schema_UnmarshalJSON-2 184kB ± 0% 184kB ± 0% ~ (p=1.000 n=5+5) Schema_MarshalJSON_raw-2 30.9kB ± 0% 30.9kB ± 0% ~ (p=0.397 n=5+5) Schema_MarshalJSON-2 56.0kB ± 0% 56.0kB ± 0% +0.01% (p=0.032 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 90.9µs ± 3% Schema_UnmarshalJSON-2 736µs ± 8% Schema_MarshalJSON_raw-2 91.9µs ± 5% Schema_MarshalJSON-2 279µs ± 3% name alloc/op Schema_UnmarshalJSON_raw-2 31.7kB ± 0% Schema_UnmarshalJSON-2 184kB ± 0% Schema_MarshalJSON_raw-2 30.9kB ± 0% Schema_MarshalJSON-2 56.0kB ± 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% ```