Skip to content

createDefaultValue does not use the default value in a $ref #2570

@bjb568

Description

@bjb568

Describe the bug

With this schema:

const schema = {
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "mydef": {
      "type": "object",
      "properties": {
        "myprop": { "type": "string" }
      }
    }
  },
  "type": "object",
  "properties": {
    "example": {
      "$ref": "#/definitions/mydef",
      "default": { "myprop": "default" }
    }
  }
}

Expected behavior

createDefaultValue(schema.properties.example, schema) should return { myprop: "default" }.

Steps to reproduce the issue

createDefaultValue(schema.properties.example, schema) returns {}.

Screenshots

No response

Which Version of JSON Forms are you using?

v3.7.0

Package

Core

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions