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

@veyronB2 can you please provide a playground link for the issue you seeing? I tried using the schema you provided in this playground and it seems to be working fine. Are you using the v5 release? It seems like maybe you are using the ancient 1.x and unsupported release.

heath-freenome avatar Feb 24 '23 16:02 heath-freenome

@heath-freenome i'm trying to do something like this as @veyronB2 tried to do, but the pattern property isn't being considered. example

igorbrasileiro avatar Mar 06 '23 17:03 igorbrasileiro

This issue has been automatically marked as possibly close because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you.

stale[bot] avatar Jun 05 '24 00:06 stale[bot]

This issue was closed because of lack of recent activity. Reopen if you still need assistance.

stale[bot] avatar Jul 05 '24 02:07 stale[bot]