首页 > 解决方案 > 如何从 json 模式中的属性引用特定属性

问题描述

我有以下 json 属性架构:

"name": {
  "$id": "#/properties/name",
  "type": "string",
  "title": "Name",
  "description": "The name of entity within the network.",
  "default": "",
  "examples": [
    "name-csc1"
  ]
},
"alias": {
  "$id": "#/properties/alias",
  "type": "string",
  "title": "Alias",
  "description": "The custom name, alias, set by the user in the network.",
  "default": "",
  "examples": [
    "Updated-Name111"
  ]

我想将属性的默认字段引用到alias属性,name因为字段的默认值aliasname值。

有没有办法在 json 模式中做到这一点?

标签: jsonjsonschema

解决方案


推荐阅读