rjsf-team/react-jsonschema-form

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

Open

#3 335 ouverte le 3 janv. 2023

Voir sur GitHub
 (1 commentaire) (0 réactions) (0 assignés)TypeScript (2 136 forks)batch import
$reffeaturehelp wanted

Métriques du dépôt

Stars
 (13 175 stars)
Métriques de merge PR
 (Merge moyen 3j 17h) (32 PRs mergées en 30 j)

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 !

Guide contributeur