rjsf-team/react-jsonschema-form

default value not working when a schema item extends a definition ($ref )

Open

#3,335 opened on Jan 3, 2023

View on GitHub
 (1 comment) (0 reactions) (0 assignees)TypeScript (13,175 stars) (2,136 forks)batch import
$reffeaturehelp wanted

Description

Prerequisites

What theme are you using?

core

Version

https://rjsf-team.github.io/react-jsonschema-form/

Current Behavior

I've carefully read the JSON forms documentation and I've seen that JSON schema 2020-12 (AJV 8) can have an item defined using the $ref property, then extended by adding its props

"item":{
	"$ref": "#/$defs/mydefinition",
	"properties":{
		...more props
	}
}

But when testing my schema (I pasted it here) in your playground, it does not work; default values are not loaded, for instance I get :

Unsupported field schema for field root_selectors_playlist_title_path: Unknown field type undefined.

{
  "default": "head title"
}

Expected Behavior

Default values should be loaded correctly.

Steps To Reproduce

  1. Head to the playground
  2. Paste this JSON schema
  3. Check the rendered form

Environment

- OS:(web playground)
- Node:(web playground)
- npm:(web playground)

Anything else?

Thanks for your help !

Contributor guide