rjsf-team/react-jsonschema-form

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

Open

#3335 aperta il 3 gen 2023

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)TypeScript (2136 fork)batch import
$reffeaturehelp wanted

Metriche repository

Star
 (13.175 star)
Metriche merge PR
 (Merge medio 3g 17h) (32 PR mergiate in 30 g)

Descrizione

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 !

Guida contributor