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

Values in "examples" (section 10.4) can be of any type #59

Closed
yvesf opened this issue Mar 7, 2019 · 1 comment
Closed

Values in "examples" (section 10.4) can be of any type #59

yvesf opened this issue Mar 7, 2019 · 1 comment

Comments

@yvesf
Copy link
Contributor

yvesf commented Mar 7, 2019

As written here:

The value of this keyword MUST be an array. There are no restrictions placed on the values within the array. [...]

However, the schema struct defines:

	Examples []string

In consequence it fails if there is a number in the examples array. The error message then looks like this:

the JSON type 'number' cannot be converted into the Go 'string' type on struct 'Schema', field 'Examples'. See input file xxxxxx.json line 553, character 1

I believe this is fixed by just changing []string to []interface{}. Since the Examples field seems to be unused in the generator the will be no conflict.

@a-h
Copy link
Owner

a-h commented Mar 12, 2019

Fixed in #60

@a-h a-h closed this as completed Mar 12, 2019
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

No branches or pull requests

2 participants