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

add example support for floats and arrays #31

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

arvidfm
Copy link
Contributor

@arvidfm arvidfm commented Jul 11, 2022

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
@arvidfm
Copy link
Contributor Author

arvidfm commented Aug 4, 2022

@samlown I've added tests now

Copy link
Contributor

@samlown samlown left a comment

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.

reflect.go Outdated Show resolved Hide resolved
reflect.go Outdated Show resolved Hide resolved
@arvidfm
Copy link
Contributor Author

arvidfm commented Jan 30, 2024

@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.

None yet

2 participants