swaggest / jsonschema-go

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

Fix enum handling #24

Closed vearutop closed 3 years ago

github-actions[bot] commented 3 years ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 6 1347 (+7) 955 (+5) 114 278 (+2) 394 (+2) 30.8K (+83B)
Go (test) 7 1290 (+16) 984 (+14) 125 181 (+2) 17 34.2K (+563B)
YAML 6 371 (+12) 322 (+10) 31 18 (+2) 0 11.7K (+349B)
github-actions[bot] commented 3 years ago

Unit Test Coverage

total: (statements) 70.8%

Coverage diff with base branch ```diff 117c117 < github.com/swaggest/jsonschema-go/reflect.go checkSchemaSetup 83.3% --- > github.com/swaggest/jsonschema-go/reflect.go checkSchemaSetup 86.4% 126c126 < github.com/swaggest/jsonschema-go/reflect.go walkProperties 77.8% --- > github.com/swaggest/jsonschema-go/reflect.go walkProperties 81.0% 130,132c130,132 < github.com/swaggest/jsonschema-go/reflect.go reflectEnum 37.5% < github.com/swaggest/jsonschema-go/reflect.go loadFromField 23.1% < total: (statements) 70.0% --- > github.com/swaggest/jsonschema-go/reflect.go reflectEnum 62.5% > github.com/swaggest/jsonschema-go/reflect.go loadFromField 30.8% > total: (statements) 70.8% ```
github-actions[bot] commented 3 years ago

API Changes

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

Codecov Report

Merging #24 (ced6f5c) into master (7d49323) will decrease coverage by 1.24%. The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #24      +/-   ##
==========================================
- Coverage   64.38%   63.13%   -1.25%     
==========================================
  Files           6        6              
  Lines         876      689     -187     
==========================================
- Hits          564      435     -129     
+ Misses        252      216      -36     
+ Partials       60       38      -22     
Flag Coverage Δ
unittests 63.13% <85.71%> (-1.25%) :arrow_down:

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

Impacted Files Coverage Δ
reflect.go 74.01% <85.71%> (+2.40%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7d49323...ced6f5c. Read the comment docs.

github-actions[bot] commented 3 years ago

Benchmark Result

Benchmark diff with base branch ``` name old time/op new time/op delta Schema_UnmarshalJSON_raw-2 90.3µs ± 2% 96.6µs ± 3% +6.93% (p=0.008 n=5+5) Schema_UnmarshalJSON-2 703µs ± 2% 781µs ± 1% +11.09% (p=0.008 n=5+5) Schema_MarshalJSON_raw-2 94.3µs ± 4% 99.7µs ± 2% +5.66% (p=0.008 n=5+5) Schema_MarshalJSON-2 293µs ± 1% 290µs ± 3% ~ (p=0.222 n=5+5) name old alloc/op new alloc/op delta Schema_UnmarshalJSON_raw-2 31.7kB ± 0% 31.7kB ± 0% ~ (p=0.556 n=5+5) Schema_UnmarshalJSON-2 180kB ± 0% 180kB ± 0% ~ (p=0.167 n=5+5) Schema_MarshalJSON_raw-2 30.9kB ± 0% 30.9kB ± 0% ~ (p=0.238 n=5+5) Schema_MarshalJSON-2 53.9kB ± 0% 53.9kB ± 0% ~ (p=0.389 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 624 ± 0% 624 ± 0% ~ (all equal) Schema_MarshalJSON-2 487 ± 0% 487 ± 0% ~ (all equal) ```
Benchmark result ``` name time/op Schema_UnmarshalJSON_raw-2 96.6µs ± 3% Schema_UnmarshalJSON-2 781µs ± 1% Schema_MarshalJSON_raw-2 100µs ± 2% Schema_MarshalJSON-2 290µs ± 3% 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 624 ± 0% Schema_MarshalJSON-2 487 ± 0% ```