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

Skip def name for a func type that may return different schemas #109

Closed vearutop closed 7 months ago

github-actions[bot] commented 7 months ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 7 2356 (+4) 1595 (+3) 275 486 (+1) 620 (+2) 56.9K (+47B)
Go (test) 13 3454 (+35) 2549 (+28) 308 597 (+7) 51 86.7K (+810B)
github-actions[bot] commented 7 months ago

Go API Changes

# summary
Inferred base version: v0.3.66
Suggested version: v0.3.67
github-actions[bot] commented 7 months ago

Unit Test Coverage

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

Coverage of changed lines | File | Function | Coverage | |----------------|----------|----------| | Total | | 100.0% | | reflect.go | | 100.0% | | reflect.go:679 | defName | 100.0% |
Coverage diff with base branch | File | Function | Base Coverage | Current Coverage | |------------|----------|---------------|------------------| | Total | | 79.2% | 79.2% (0.0%) | | reflect.go | defName | 81.5% | 82.8% (+1.3%) |
github-actions[bot] commented 7 months ago

Benchmark Result

Benchmark diff with base branch ``` name old time/op new time/op delta Schema_UnmarshalJSON_raw-4 60.6µs ± 1% 60.3µs ± 0% ~ (p=0.082 n=6+5) Schema_UnmarshalJSON-4 489µs ± 3% 482µs ± 1% -1.27% (p=0.041 n=6+6) Schema_MarshalJSON_raw-4 43.7µs ± 1% 44.1µs ± 1% ~ (p=0.065 n=6+6) Schema_MarshalJSON-4 184µs ± 1% 184µs ± 1% ~ (p=0.818 n=6+6) name old alloc/op new alloc/op delta Schema_UnmarshalJSON_raw-4 31.7kB ± 0% 31.7kB ± 0% ~ (p=0.394 n=6+6) Schema_UnmarshalJSON-4 180kB ± 0% 180kB ± 0% ~ (all equal) Schema_MarshalJSON_raw-4 14.6kB ± 0% 14.6kB ± 0% ~ (p=0.667 n=6+4) Schema_MarshalJSON-4 53.9kB ± 0% 53.9kB ± 0% +0.01% (p=0.030 n=6+5) name old allocs/op new allocs/op delta Schema_UnmarshalJSON_raw-4 457 ± 0% 457 ± 0% ~ (all equal) Schema_UnmarshalJSON-4 1.85k ± 0% 1.85k ± 0% ~ (all equal) Schema_MarshalJSON_raw-4 370 ± 0% 370 ± 0% ~ (all equal) Schema_MarshalJSON-4 468 ± 0% 468 ± 0% ~ (all equal) ```
Benchmark result ``` name time/op Schema_UnmarshalJSON_raw-4 60.3µs ± 0% Schema_UnmarshalJSON-4 482µs ± 1% Schema_MarshalJSON_raw-4 44.1µs ± 1% Schema_MarshalJSON-4 184µs ± 1% name alloc/op Schema_UnmarshalJSON_raw-4 31.7kB ± 0% Schema_UnmarshalJSON-4 180kB ± 0% Schema_MarshalJSON_raw-4 14.6kB ± 0% Schema_MarshalJSON-4 53.9kB ± 0% name allocs/op Schema_UnmarshalJSON_raw-4 457 ± 0% Schema_UnmarshalJSON-4 1.85k ± 0% Schema_MarshalJSON_raw-4 370 ± 0% Schema_MarshalJSON-4 468 ± 0% ```
codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 74.16%. Comparing base (ee6e1be) to head (52862fb).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #109 +/- ## ========================================== + Coverage 74.11% 74.16% +0.04% ========================================== Files 7 7 Lines 1221 1223 +2 ========================================== + Hits 905 907 +2 Misses 244 244 Partials 72 72 ``` | [Flag](https://app.codecov.io/gh/swaggest/jsonschema-go/pull/109/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=swaggest) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/swaggest/jsonschema-go/pull/109/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=swaggest) | `74.16% <100.00%> (+0.04%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=swaggest#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.