Skip to content

add example support for floats and arrays - #31

Open
ecryth wants to merge 11 commits into
invopop:mainfrom
ecryth:example
Open

add example support for floats and arrays#31
ecryth wants to merge 11 commits into
invopop:mainfrom
ecryth:example

Conversation

@ecryth

@ecryth ecryth commented Jul 11, 2022

Copy link
Copy Markdown
Contributor

This PR adds support for the example keyword for floats and arrays. For arrays, it expects a format like:

MyArray []string `jsonschema:"example=A;B"`

@samlown samlown added the needs tests Not enough tests for this to be accepted label Jul 21, 2022
@ecryth

ecryth commented Aug 4, 2022

Copy link
Copy Markdown
Contributor Author

@samlown I've added tests now

@samlown samlown left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for this! It'd be great to fix parseValue return values if possible.

Comment thread reflect.go Outdated
Comment thread reflect.go Outdated
@ecryth

ecryth commented Jan 30, 2024

Copy link
Copy Markdown
Contributor Author

@samlown Sorry for not having gotten around to this until now, but I've now addressed your comments. I adjusted the Type == "" case to accept any kind of value instead of just JSON objects, and added a corresponding test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs tests Not enough tests for this to be accepted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants