swaggest / jsonschema-go

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

Add reflect context to interceptor params #83

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 2095 (+8) 1414 (+8) 253 428 542 51K (+188B)
Go (test) 12 2729 (+6) 1973 (+3) 284 472 (+3) 48 69K (+104B)
github-actions[bot] commented 1 year ago

Go API Changes

# github.com/swaggest/jsonschema-go
## compatible changes
InterceptNullabilityParams.Context: added
InterceptPropParams.Context: added
InterceptSchemaParams.Context: added

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

Unit Test Coverage

total: (statements) 78.1% changed lines: (statements) 100.0%

Coverage of changed lines | File | Function | Coverage | |-----------------|------------------|----------| | Total | | 100.0% | | reflect.go | | 100.0% | | reflect.go:347 | reflect | 100.0% | | reflect.go:806 | walkProperties | 100.0% | | reflect.go:1075 | checkNullability | 100.0% |
Coverage diff with base branch No changes in coverage.
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 76.8µs ± 1% 76.6µs ± 0% ~ (p=0.421 n=5+5) Schema_UnmarshalJSON-2 596µs ± 1% 594µs ± 1% ~ (p=0.180 n=6+6) Schema_MarshalJSON_raw-2 71.6µs ± 2% 71.0µs ± 1% ~ (p=0.065 n=6+6) Schema_MarshalJSON-2 236µs ± 1% 235µs ± 1% ~ (p=0.589 n=6+6) name old alloc/op new alloc/op delta Schema_UnmarshalJSON_raw-2 31.7kB ± 0% 31.7kB ± 0% ~ (p=0.370 n=6+6) Schema_UnmarshalJSON-2 184kB ± 0% 184kB ± 0% ~ (all equal) Schema_MarshalJSON_raw-2 21.9kB ± 0% 21.9kB ± 0% ~ (p=0.143 n=6+4) Schema_MarshalJSON-2 55.3kB ± 0% 55.3kB ± 0% ~ (p=0.071 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 76.6µs ± 0% Schema_UnmarshalJSON-2 594µs ± 1% Schema_MarshalJSON_raw-2 71.0µs ± 1% Schema_MarshalJSON-2 235µ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% ```
codecov[bot] commented 1 year ago

Codecov Report

Merging #83 (779e122) into master (755d963) will increase coverage by 0.12%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #83      +/-   ##
==========================================
+ Coverage   72.78%   72.90%   +0.12%     
==========================================
  Files           6        6              
  Lines        1117     1122       +5     
==========================================
+ Hits          813      818       +5     
  Misses        235      235              
  Partials       69       69              
Flag Coverage Δ
unittests 72.90% <100.00%> (+0.12%) :arrow_up:

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

Impacted Files Coverage Δ
context.go 46.57% <ø> (ø)
reflect.go 82.64% <100.00%> (+0.15%) :arrow_up:

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