Skip to content

How to change the schema of references property in the JS API? #153

Answered by bhch
ErikKoinberg asked this question in Q&A
Discussion options

You must be logged in to vote

I suppose that unless the defs are compiled into individual properties, it is not going to be possible to change an aspect of a single referencing instance

Overriding specific properties of a referenced definition is supported.

You can paste this schema in the playground and the last_name field should be hidden:

{
  "type": "object",
  "properties": {
    "first_name": {
      "$ref": "#/$defs/name"
    },
    "last_name": {
      "$ref": "#/$defs/name",
      "widget": "hidden"
    }
  },
  "$defs": {
    "name": {"type": "string"}
  }
}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@bhch
Comment options

bhch Feb 16, 2024
Maintainer

Answer selected by ErikKoinberg
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants