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 ParentSchema to intercept prop params #97

Closed vearutop closed 9 months ago

github-actions[bot] commented 9 months ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 7 2294 (+3) 1554 (+3) 269 471 599 55.2K (+98B)
Go (test) 13 3259 (+45) 2393 (+38) 305 561 (+7) 51 (+3) 81.9K (+1.1K)
github-actions[bot] commented 9 months ago

Go API Changes

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

# summary
Inferred base version: v0.3.60
Suggested version: v0.4.0
github-actions[bot] commented 9 months ago

Unit Test Coverage

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

Coverage of changed lines | File | Function | Coverage | |----------------|----------------|----------| | Total | | 100.0% | | reflect.go | | 100.0% | | reflect.go:880 | walkProperties | 100.0% |
Coverage diff with base branch No changes in coverage.
github-actions[bot] commented 9 months ago

Benchmark Result

Benchmark diff with base branch ``` name old time/op new time/op delta Schema_UnmarshalJSON_raw-2 79.5µs ± 2% 78.8µs ± 2% ~ (p=0.180 n=6+6) Schema_UnmarshalJSON-2 595µs ± 2% 590µs ± 1% ~ (p=0.429 n=6+5) Schema_MarshalJSON_raw-2 71.9µs ± 1% 72.7µs ± 3% ~ (p=0.093 n=6+6) Schema_MarshalJSON-2 243µs ± 1% 244µs ± 2% ~ (p=0.429 n=5+6) name old alloc/op new alloc/op delta Schema_UnmarshalJSON_raw-2 31.6kB ± 0% 31.6kB ± 0% ~ (p=0.459 n=6+6) Schema_UnmarshalJSON-2 184kB ± 0% 184kB ± 0% ~ (all equal) Schema_MarshalJSON_raw-2 21.9kB ± 0% 21.9kB ± 0% ~ (all equal) Schema_MarshalJSON-2 55.3kB ± 0% 55.3kB ± 0% ~ (p=0.320 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 78.8µs ± 2% Schema_UnmarshalJSON-2 590µs ± 1% Schema_MarshalJSON_raw-2 72.7µs ± 3% Schema_MarshalJSON-2 244µs ± 2% name alloc/op Schema_UnmarshalJSON_raw-2 31.6kB ± 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 9 months ago

Codecov Report

Merging #97 (e8d7379) into master (f6cad16) will increase coverage by 0.04%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #97      +/-   ##
==========================================
+ Coverage   73.70%   73.74%   +0.04%     
==========================================
  Files           7        7              
  Lines        1194     1196       +2     
==========================================
+ Hits          880      882       +2     
  Misses        243      243              
  Partials       71       71              
Flag Coverage Δ
unittests 73.74% <100.00%> (+0.04%) :arrow_up:

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

Files Coverage Δ
context.go 46.91% <ø> (ø)
reflect.go 84.16% <100.00%> (+0.05%) :arrow_up:

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