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

Improve example inferring with JSON support and type cohesion #114

Closed vearutop closed 6 months ago

github-actions[bot] commented 6 months ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 7 2376 (-39) 1619 (-30) 275 482 (-9) 629 (-25) 57.4K (-804B)
Go (test) 13 4047 (+36) 3000 (+27) 310 (+2) 737 (+7) 51 102.7K (+1.1K)
Markdown 4 318 (+5) 254 (+3) 0 64 (+2) 0 14K (+503B)
YAML 6 500 (+2) 414 (+2) 36 50 0 16.4K (+32B)
github-actions[bot] commented 6 months ago

Go API Changes

# summary
Inferred base version: v0.3.69
Suggested version: v0.3.70
github-actions[bot] commented 6 months ago

Unit Test Coverage

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

Coverage of changed lines | File | Function | Coverage | |-----------------|-----------------|----------| | Total | | 63.6% | | reflect.go | | 63.6% | | reflect.go:1334 | reflectExamples | 100.0% | | reflect.go:1354 | reflectExample | 85.7% | | reflect.go:1004 | walkProperties | 71.4% |
Coverage diff with base branch | File | Function | Base Coverage | Current Coverage | |------------|------------------|---------------|------------------| | Total | | 80.4% | 80.4% (0.0%) | | reflect.go | checkInlineValue | 92.3% | 96.2% (+3.9%) | | reflect.go | reflectExample | 84.6% | 80.0% (-4.6%) | | reflect.go | walkProperties | 84.9% | 84.3% (-0.6%) |
github-actions[bot] commented 6 months ago

Benchmark Result

Benchmark diff with base branch ``` name old time/op new time/op delta Schema_UnmarshalJSON_raw-4 60.5µs ± 0% 60.7µs ± 0% ~ (p=0.095 n=5+5) Schema_UnmarshalJSON-4 488µs ± 2% 486µs ± 0% ~ (p=0.589 n=6+6) Schema_MarshalJSON_raw-4 43.5µs ± 0% 43.3µs ± 1% ~ (p=0.240 n=6+6) Schema_MarshalJSON-4 184µs ± 0% 184µs ± 1% ~ (p=0.329 n=5+6) name old alloc/op new alloc/op delta Schema_UnmarshalJSON_raw-4 31.7kB ± 0% 31.7kB ± 0% ~ (p=0.874 n=6+5) Schema_UnmarshalJSON-4 180kB ± 0% 180kB ± 0% ~ (all equal) Schema_MarshalJSON_raw-4 14.6kB ± 0% 14.6kB ± 0% ~ (p=0.242 n=6+5) Schema_MarshalJSON-4 53.9kB ± 0% 53.9kB ± 0% ~ (p=0.225 n=6+6) 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.7µs ± 0% Schema_UnmarshalJSON-4 486µs ± 0% Schema_MarshalJSON_raw-4 43.3µ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 6 months ago

Codecov Report

Attention: Patch coverage is 40.00000% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 75.82%. Comparing base (9575eb9) to head (94c00f6).

Files Patch % Lines
reflect.go 40.00% 2 Missing and 4 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #114 +/- ## ========================================== + Coverage 75.78% 75.82% +0.03% ========================================== Files 7 7 Lines 1272 1249 -23 ========================================== - Hits 964 947 -17 + Misses 241 237 -4 + Partials 67 65 -2 ``` | [Flag](https://app.codecov.io/gh/swaggest/jsonschema-go/pull/114/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/114/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=swaggest) | `75.82% <40.00%> (+0.03%)` | :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.