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 InterceptDefName context option #90

Closed vearutop closed 11 months ago

github-actions[bot] commented 11 months ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 6 2120 (+17) 1430 (+11) 258 (+4) 432 (+2) 552 (+3) 51.8K (+531B)
Go (test) 12 2855 (+6) 2072 (+6) 289 494 48 72.4K (+203B)
github-actions[bot] commented 11 months ago

Unit Test Coverage

total: (statements) 78.1% changed lines: (statements) 37.5%, coverage is less than 90.0%, consider testing the changes more thoroughly

Coverage of changed lines | File | Function | Coverage | |----------------|------------------|----------| | Total | | 37.5% | | context.go | | 42.9% | | context.go:174 | InterceptDefName | 33.3% | | reflect.go | | 0.0% | | reflect.go:117 | InterceptDefName | 0.0% |
Coverage diff with base branch | File | Function | Base Coverage | Current Coverage | |----------------------------------------------|------------------|---------------|------------------| | Total | | 78.4% | 78.1% (-0.3%) | | github.com/swaggest/jsonschema-go/context.go | InterceptDefName | no function | 42.9% | | github.com/swaggest/jsonschema-go/reflect.go | InterceptDefName | 100.0% | 0.0% (-100.0%) |
github-actions[bot] commented 11 months ago

Go API Changes

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

# summary
Inferred base version: v0.3.54
Suggested version: v0.4.0
codecov[bot] commented 11 months ago

Codecov Report

Merging #90 (d0c338b) into master (2e84ce3) will decrease coverage by 0.39%. The diff coverage is 33.33%.

@@            Coverage Diff             @@
##           master      #90      +/-   ##
==========================================
- Coverage   73.53%   73.14%   -0.39%     
==========================================
  Files           6        6              
  Lines        1126     1132       +6     
==========================================
  Hits          828      828              
- Misses        232      237       +5     
- Partials       66       67       +1     
Flag Coverage Δ
unittests 73.14% <33.33%> (-0.39%) :arrow_down:

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

Files Changed Coverage Δ
reflect.go 83.39% <0.00%> (-0.23%) :arrow_down:
context.go 46.91% <37.50%> (-1.04%) :arrow_down:

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

github-actions[bot] commented 11 months ago

Benchmark Result

Benchmark diff with base branch ``` name old time/op new time/op delta Schema_UnmarshalJSON_raw-2 96.5µs ± 4% 103.5µs ± 3% +7.27% (p=0.002 n=6+6) Schema_UnmarshalJSON-2 737µs ± 1% 797µs ± 4% +8.08% (p=0.002 n=6+6) Schema_MarshalJSON_raw-2 88.3µs ± 4% 88.8µs ± 4% ~ (p=0.818 n=6+6) Schema_MarshalJSON-2 305µs ± 3% 312µs ± 8% ~ (p=0.699 n=6+6) name old alloc/op new alloc/op delta Schema_UnmarshalJSON_raw-2 31.7kB ± 0% 31.7kB ± 0% ~ (p=1.000 n=6+6) Schema_UnmarshalJSON-2 184kB ± 0% 184kB ± 0% ~ (p=1.000 n=6+6) Schema_MarshalJSON_raw-2 21.9kB ± 0% 21.9kB ± 0% ~ (p=0.675 n=6+6) Schema_MarshalJSON-2 55.3kB ± 0% 55.3kB ± 0% ~ (p=0.242 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 104µs ± 3% Schema_UnmarshalJSON-2 797µs ± 4% Schema_MarshalJSON_raw-2 88.8µs ± 4% Schema_MarshalJSON-2 312µs ± 8% 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% ```