react-jsonschema-form icon indicating copy to clipboard operation
react-jsonschema-form copied to clipboard

No widget "int64" for type "integer" issue with format set to int64

Open veyronB2 opened this issue 2 years ago • 3 comments

Prerequisites

What theme are you using?

bootstrap-4

What is your question?

Hi all,

I'm after some advice please.

I'm building dynamic forms based on a schema which contains various format properties such as int64, double, int32, uuid and few others and always get a message similar to the one in the subject. Without it, everything seems OK i.e. errors checking etc.

I have managed to bypass the error message by creating a custom widget for int64 for example but then the error checking stops working for the entire form and not just the single field.

import UpDownWidget from "react-jsonschema-form/lib/components/widgets/UpDownWidget.js" 

const schema = {
    "type": "object",
    "required": [
        "account",
    ],
    "properties": {
        "Reference": {
            "type": "string",
            "description": "Testing description",
            "nullable": true,
            "minLength":5,
        },
        "account": {
            "type": "integer",
            "minLength":5,
            "pattern":"^(0|[1-9][0-9]*)$",
            "format": 'int64',
        }
    },
    "additionalProperties": false
};

const customwidgets= {
       "int64": UpDownWidget,
    }

<Form schema={schema}
        widgets={ customwidgets }
        onSubmit={()=> console.log("Submitted")}
        noHtml5Validate={true}

       />
  );

I've tried using the play ground and I'm getting the same result unfortunately.

Is it possible to somehow ignore format property if not, how to make error checking work with this approach if possible at all.

My schema also contains fields exclusiveMaximum or exclusiveMinimum and I would like to ignore these as well as they seem to effect error checking as well i.e no inline errors are showing.

Any help is much appreciated

veyronB2 avatar Feb 20 '23 16:02 veyronB2