swaggest / jsonschema-go

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

Add interceptor to control definition names #21

Closed vearutop closed 3 years ago

github-actions[bot] commented 3 years ago

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 6 1337 (+17) 948 (+9) 114 (+4) 275 (+4) 388 (+2) 30.6K (+634B)
Go (test) 7 1250 (+3) 949 (+1) 125 (+1) 176 (+1) 17 33.1K (-296B)
Makefile 1 39 (-8) 28 (-6) 4 (-1) 7 (-1) 2 (-3) 1.2K (-853B)
YAML 6 (+2) 360 (+85) 313 (+75) 31 (+7) 16 (+3) 0 11.4K (+2.6K)
github-actions[bot] commented 3 years ago

Unit Test Coverage

total: (statements) 70.1%

Coverage diff with base branch ```diff 115a116 > github.com/swaggest/jsonschema-go/reflect.go InterceptDefName 100.0% 117c118 < github.com/swaggest/jsonschema-go/reflect.go Reflect 95.0% --- > github.com/swaggest/jsonschema-go/reflect.go Reflect 100.0% 122c123 < github.com/swaggest/jsonschema-go/reflect.go defName 78.3% --- > github.com/swaggest/jsonschema-go/reflect.go defName 80.0% 131c132 < total: (statements) 69.8% --- > total: (statements) 70.1% ```
codecov[bot] commented 3 years ago

Codecov Report

Merging #21 (41a1676) into master (6bece79) will decrease coverage by 1.22%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #21      +/-   ##
==========================================
- Coverage   64.36%   63.14%   -1.23%     
==========================================
  Files           6        6              
  Lines         870      700     -170     
==========================================
- Hits          560      442     -118     
+ Misses        252      221      -31     
+ Partials       58       37      -21     
Flag Coverage Δ
unittests 63.14% <100.00%> (-1.23%) :arrow_down:

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

Impacted Files Coverage Δ
context.go 38.23% <ø> (-1.77%) :arrow_down:
reflect.go 73.61% <100.00%> (+1.92%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6bece79...41a1676. Read the comment docs.

github-actions[bot] commented 3 years ago

Benchmark Result

Benchmark diff with base branch ``` name old time/op new time/op delta Schema_UnmarshalJSON_raw-2 90.9µs ±12% 98.6µs ± 8% +8.50% (p=0.048 n=5+5) Schema_UnmarshalJSON-2 720µs ± 4% 719µs ± 2% ~ (p=1.000 n=5+5) Schema_MarshalJSON_raw-2 103µs ± 6% 101µs ± 1% ~ (p=0.841 n=5+5) Schema_MarshalJSON-2 315µs ± 7% 309µs ± 2% ~ (p=0.548 n=5+5) name old alloc/op new alloc/op delta Schema_UnmarshalJSON_raw-2 31.7kB ± 0% 31.7kB ± 0% ~ (p=0.984 n=5+5) Schema_UnmarshalJSON-2 187kB ± 0% 187kB ± 0% ~ (all equal) Schema_MarshalJSON_raw-2 28.8kB ± 0% 28.8kB ± 0% ~ (p=0.397 n=5+5) Schema_MarshalJSON-2 53.8kB ± 0% 53.8kB ± 0% ~ (p=0.714 n=5+5) name old allocs/op new allocs/op delta Schema_UnmarshalJSON_raw-2 457 ± 0% 457 ± 0% ~ (all equal) Schema_UnmarshalJSON-2 1.94k ± 0% 1.94k ± 0% ~ (all equal) Schema_MarshalJSON_raw-2 621 ± 0% 621 ± 0% ~ (all equal) Schema_MarshalJSON-2 484 ± 0% 484 ± 0% ~ (all equal) ```
github-actions[bot] commented 3 years ago

Exported API Changes Report

# github.com/swaggest/jsonschema-go
## compatible changes
(*Reflector).InterceptDefName: added
ReflectContext.DefName: added

# summary
Inferred base version: v0.3.19
Suggested version: v0.4.0