JSON Schema#

A urljsf form definition should conform to the overall JSON schema, and may include additional, nested schema and documents, represented inline or referenced by URL.

The Draft 7 schema is used due to its wide implementation but, most specifically, it is the latest draft natively supported in rjsf.

urljsf#

A schema for building forms for building URLs for building…

https://urljsf.rtfd.org/en/latest/_static/urljsf/schema/v0/form.schema.json

type

object

properties

  • $id

an optional identifier for this instance of the urljsf schema

type

string

format

uri-reference

  • $schema

an optional identifier for the urljsf schema that constrains this: this can be used by non-urljsf tools to validate and provide more insight while authoring.

type

string

format

uri-reference

  • checks

markdown templates, which if rendered to any non-whitespace, will be treated as an error, preventing the submit button from being shown.

checks

  • forms

forms that describe how to build the URL

forms

  • iframe

isolate each form on the page in an iframe

type

boolean

  • iframe_style

additional simple CSS to apply to an iframe element (implies iframe)

type

string

  • no_bootstrap

don’t try to add a link to bootstrap if missing.

type

boolean

default

False

  • nunjucks

options for the nunjucks environment

type

object

properties

  • filters

extra filters to make available in nunjucks templates

type

array

items

oneOf

File Format

enum

zip

uniqueItems

True

  • style

simple CSS rules scoped to the current form id, or objects keyed by child selector

styles

  • templates

nunjucks templates that control URLs for machines and markdown for humans

templates

additionalProperties

False

Props#

JSON-compatible default values for rjsf Form.props.

type

object

properties

  • acceptCharset

The value of this prop will be passed to the accept-charset HTML attribute on the form

type

string

  • action

The value of this prop will be passed to the action HTML attribute on the form

NOTE: this just renders the action attribute in the HTML markup. There is no real network request being sent to this action on submit. Instead, react-jsonschema-form catches the submit event with event.preventDefault() and then calls the onSubmit function, where you could send a request programmatically with fetch or similar.

type

string

  • autoComplete

The value of this prop will be passed to the autocomplete HTML attribute on the form

type

string

  • className

The value of this prop will be passed to the class HTML attribute on the form

type

string

  • disabled

It’s possible to disable the whole form by setting the disabled prop. The disabled prop is then forwarded down to each field of the form. If you just want to disable some fields, see the ui:disabled parameter in uiSchema

type

boolean

  • enctype

The value of this prop will be passed to the enctype HTML attribute on the form

type

string

  • extraErrorsBlockSubmit

If set to true, causes the extraErrors to become blocking when the form is submitted

type

boolean

  • focusOnFirstError

If set to true, then the first field with an error will receive the focus when the form is submitted with errors

type

boolean

  • formContext

globals for custom UI

type

object

  • formData

The data for the form, used to prefill a form with existing data

type

object

  • id

The value of this prop will be passed to the id HTML attribute on the form

type

string

  • idPrefix

To avoid collisions with existing ids in the DOM, it is possible to change the prefix used for ids; Default is root

type

string

  • idSeparator

To avoid using a path separator that is present in field names, it is possible to change the separator used for ids (Default is _)

type

string

  • liveOmit

If omitExtraData and liveOmit are both set to true, then extra form data values that are not in any form field will be removed whenever onChange is called. Set to false by default

type

boolean

  • liveValidate

If set to true, the form will perform validation and show any validation errors whenever the form data is changed, rather than just on submit

type

boolean

  • method

The value of this prop will be passed to the method HTML attribute on the form

type

string

  • name

The value of this prop will be passed to the name HTML attribute on the form

type

string

  • noHtml5Validate

If set to true, turns off HTML5 validation on the form; Set to false by default

type

boolean

  • omitExtraData

If set to true, then extra form data values that are not in any form field will be removed whenever onSubmit is called. Set to false by default.

type

boolean

  • readonly

It’s possible to make the whole form read-only by setting the readonly prop. The readonly prop is then forwarded down to each field of the form. If you just want to make some fields read-only, see the ui:readonly parameter in uiSchema

type

boolean

  • schema

The JSON schema object for the form

type

object

  • showErrorList

When this prop is set to top or ‘bottom’, a list of errors (or the custom error list defined in the ErrorList) will also show. When set to false, only inline input validation errors will be shown. Set to top by default

type

boolean / string

enum

False, top, bottom

  • tagName

It’s possible to change the default form tag name to a different HTML tag, which can be helpful if you are nesting forms. However, native browser form behaviour, such as submitting when the Enter key is pressed, may no longer work

type

string

  • target

The value of this prop will be passed to the target HTML attribute on the form

type

string

  • uiSchema

The uiSchema for the form

UISchema

additionalProperties

False

UISchema#

type

object

properties

  • items

An array of objects representing the items in the array

UISchema

  • ui:field

Allows RJSF to override the default field implementation by specifying either the name of a field that is used to look up an implementation from the fields list or an actual one-off Field component implementation itself

type

string

  • ui:fieldReplacesAnyOrOneOf

type

boolean

  • ui:options

An object that contains all the potential UI options in a single object

type

object

properties

  • title

We know that for title, it will be a string, if it is provided

type

string

  • description

We know that for description, it will be a string, if it is provided

type

string

  • classNames

Any classnames that the user wants to be applied to a field in the ui

type

string

  • disabled

Flag, if set to true, will mark all child widgets from a given field as disabled

type

boolean

  • emptyValue

The default value to use when an input for a field is empty

anyOf

type

boolean

type

number

type

string

type

object

properties

allOf

type

array

items

type

object

properties

type

null

  • enumDisabled

Will disable any of the enum options specified in the array (by value)

type

array

items

type

string / number / boolean

  • enumNames

Allows a user to provide a list of labels for enum values in the schema

anyOf

type

boolean

type

number

type

string

allOf

type

array

items

type

string

type

object

properties

allOf

type

array

items

type

string

type

array

items

type

null

  • filePreview

Flag, if set to true, will cause the FileWidget to show a preview (with download for non-image files)

type

boolean

  • help

Used to add text next to a field to guide the end user in filling it in

type

string

  • hideError

Flag, if set to true, will hide the default error display for the given field AND all of its child fields in the hierarchy

type

boolean

  • inline

Flag, if set to true, will mark a list of checkboxes as displayed all on one line instead of one per row

type

boolean

  • inputType

Used to change the input type (for example, tel or email) for an

type

string

  • order

This property allows you to reorder the properties that are shown for a particular object

anyOf

type

boolean

type

number

type

string

allOf

type

array

items

type

string

type

object

properties

allOf

type

array

items

type

string

type

array

items

type

null

  • placeholder

We know that for placeholder, it will be a string, if it is provided

type

string

  • readonly

Flag, if set to true, will mark all child widgets from a given field as read-only

type

boolean

  • rows

Provides a means to set the initial height of a textarea widget

type

number

  • style

type

object

  • urljsf:grid

custom overrides for urlsjf grid

type

object

properties

  • addButton

type

array

items

type

string

  • children

type

object

additionalProperties

type

array

items

type

string

  • default

type

array

items

type

string

additionalProperties

False

  • widget

type

string

  • ui:rootFieldId

type

string

additionalProperties

anyOf

UISchema

File Format#

a format that can be serialized or deserialized

type

string

enum

json, toml, yaml

Any Form#

a definition of a form

type

object

properties

  • form_data

JSON-compatible initial data for this form

A Schema

  • order

the order in which to show a form, lowest (or omitted) first, with a tiebreaker on name

type

number

  • props

JSON-compatible subset of rjsf component properties for this form

oneOf

Props

type

string

format

#/definitions/any-schema-location

  • schema

URL for a JSON schema to describe the this form: features not present in Draft 7 are best-effort.

A Schema

  • ui_schema

URL for an rjsf UI schema to describe how the schema will be presented

A Schema

additionalProperties

False

An Inline Object#

A literal object

type

object

A Schema#

A schema-like object referenced by URL, or inline as an object

oneOf

Schema By URL

any-schema-location

Inline Object

An Inline Object

any-schema-location#

a path to a JSON schema, serialized as JSON, TOML, or (simple) YAML. The URN-like py:module.submodule:member may be used to reference an importable module dict or str member, or function that returns one, and will be expanded into a JSON object or URL.

type

string

minLength

1

format

uri-reference

any-style#

A CSS rule, or a nested selector object containing more rules

oneOf

type

string

type

object

any-template#

anyOf

a nunjucks template as a simple string

type

string

a template as a list of strings that will be concatenated before being rendered

type

array

items

type

string

minItems

1

checks#

nunjucks templates keyed by the label displayed to a form user: any evaluating to a non-whitespace string will be considered failing.

type

object

additionalProperties

any-template

forms#

forms used to build and populate a URL

type

object

patternProperties

  • [a-zA-Z\d\-_]+

Any Form

known-templates#

type

object

properties

  • download_filename

If given, a template for the submit button’s download attribute, to suggest an appropriate filename. Leading and trailing whitespace will be trimmed.

any-template

  • submit_button

Markdown to show on the button when a form is valid. Multiple lines will be joined with \n. Leading and trailing whitespace will be trimmed. If empty, no submit button will be shown.

any-template

  • submit_target

If given, the value of the target attribute on the submit_button. Use _blank to open a new tab.

any-template

  • url

a URL to apply to the submit button. All whitespace will be removed.

any-template

styles#

CSS rules, or nested selector objects containing more rules

type

object

patternProperties

  • ^.+$

any-style

templates#

nunjucks strings (or lists of strings) that control how strings are built from forms. See documentation for further customizations.

allOf

known-templates

type

object

additionalProperties

any-template