Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use JSON for examples of type object #1801

Merged
merged 1 commit into from
Nov 17, 2018

Conversation

leon-barrett
Copy link
Contributor

The OpenAPI 2.0 spec allows examples to be any JSON value. Currently,
go-swagger supports most types (e.g. ints and strings), but not objects.
This adds support to parse object examples as JSON, allowing users to
document examples for maps.

The OpenAPI 2.0 spec allows examples to be any JSON value. Currently,
go-swagger supports most types (e.g. ints and strings), but not objects.
This adds support to parse object examples as JSON, allowing users to
document examples for maps.

Signed-off-by: Leon Barrett <leon@cogitai.com>
@codecov
Copy link

codecov bot commented Nov 17, 2018

Codecov Report

Merging #1801 into master will decrease coverage by 0.05%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1801      +/-   ##
==========================================
- Coverage   80.13%   80.07%   -0.06%     
==========================================
  Files          38       38              
  Lines        7489     7494       +5     
==========================================
  Hits         6001     6001              
- Misses       1009     1014       +5     
  Partials      479      479
Impacted Files Coverage Δ
scan/validators.go 76.67% <0%> (-0.97%) ⬇️

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 2b7d9e3...6fb3fbc. Read the comment docs.

@fredbi
Copy link
Contributor

fredbi commented Nov 17, 2018

Could you please add some unit test to assert this behaves as expected?

@casualjim
Copy link
Member

there is a test already

@casualjim casualjim merged commit 1200dd8 into go-swagger:master Nov 17, 2018
@leon-barrett leon-barrett deleted the leon/object-example branch November 17, 2018 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants