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

When schema type inferred, boolean enum values incorrectly deserialized as strings #1129

Closed
kerrykimbrough opened this issue Jun 18, 2019 · 2 comments

Comments

@kerrykimbrough
Copy link
Contributor

Consider the following schema:

{
  "enum": [ true, false]
}

When deserialized to a Schema object, the type is correctly inferred to be "boolean":

assertEquals(  schema.getType(), "boolean"); // Passes

But "enum" values are not deserialized correctly:

assertEquals( schema.getEnum().get(0), "true"); // Passes!
assertEquals( schema.getEnum().get(1), Boolean.FALSE); // Fails!
kerrykimbrough added a commit to kerrykimbrough/swagger-parser that referenced this issue Jun 18, 2019
@kerrykimbrough
Copy link
Contributor Author

This defect is demonstrated and repaired by changes in PR #1130

gracekarina added a commit that referenced this issue Jun 19, 2019
@gracekarina
Copy link
Contributor

this issue was closed by #1130

gracekarina pushed a commit that referenced this issue Jul 5, 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