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

schema produced for an integer field breaks react-jsonschema-form #40

Closed
rsyring opened this issue Jul 26, 2017 · 2 comments
Closed

schema produced for an integer field breaks react-jsonschema-form #40

rsyring opened this issue Jul 26, 2017 · 2 comments

Comments

@rsyring
Copy link

rsyring commented Jul 26, 2017

I've created a marshmallow schema with an integer field. This library generates JSON schema for the field as:

    "id": {
      "format": "integer",
      "title": "id",
      "type": "number"
    },

When I feed that schema to the Form React component from https://github.com/mozilla-services/react-jsonschema-form, I get an error:

Error: No widget "integer" for type "number"

Based on their examples and my limited reading of the JSON Schema spec, maybe the correct JSON schema should be:

    "id": {
      "title": "id",
      "type": "integer"
    },
@bartfeenstra
Copy link

bartfeenstra commented Nov 4, 2017

JSON Schema v4 and v6 both allow both integer and number, so the schema output is correct. If I read https://github.com/mozilla-services/react-jsonschema-form#for-number-and-integer-fields correctly, that means you used integer as the widget type, but you can only choose from the updown, range, and radio widgets for either an integer or number field.

@fuhrysteve
Copy link
Owner

Sounds like this isn't an issue in marshmallow-jsonschema, so closing for now. Please reopen if anyone thinks there's something that needs to be addressed still!

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

3 participants