简体   繁体   English

如何在json模式中定义值?

[英]how to define the values in json schema?

I have created the jsonform using jsonschema. 我使用jsonschema创建了jsonform。 But i need to define the external values in schema. 但我需要在架构中定义外部值。 for ex : to define the first name value externally. 例如:在外部定义名字值。 I tried with $ref to define external json but still it not works. 我尝试使用$ ref来定义外部json,但它仍然不起作用。 In my local json values are : [{ "male": "blah blah", "female": "woof woof" }] 在我当地的json值是:[{“male”:“blah blah”,“female”:“woof woof”}]

I inject the json values in to the below schema 我将json值注入以下模式

"value": { "$ref": "data3.json"} “value”:{“$ ref”:“data3.json”}

can anyone please let me know the solution? 任何人都可以让我知道解决方案吗?

Try this 尝试这个

$var1='{ "male": "boy", "female": "girl" }'; $ var1 ='{“male”:“boy”,“female”:“girl”}';

test it like this 像这样测试它

echo $var1; echo $ var1;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 JSON模式-如何定义依赖于文件中其他值的类型 - JSON schema - how to define types that depend on values elsewhere in file 如何为复杂的json文档定义avro模式? - How to define avro schema for complex json document? 如何在Json Schema 4中定义类型百分比的属性 - How to define property of type percentage in Json Schema 4 如何在JSON模式中使用真实名称定义对象? - How to define an object with a veriable name in JSON Schema? 如何定义架构任意JSON对象? - How to define schema arbitrary JSON object? 如何在json模式中定义数组的最小大小 - How to define the min size of array in the json schema 如何为 Map 定义 JSON 架构<string, integer> ?</string,> - How to define JSON Schema for Map<String, Integer>? JSON模式-如何在对象递归中定义对象 - JSON Schema - How to define object in object recursive 如何为复杂的json文档定义avro模式? - How to define avro schema for complex json document? 如何使用 (Py)Spark Structured Streaming 定义带有时间戳的 JSON 记录的架构(来自 Kafka)? - 显示 null 值 - How to define schema for JSON records with timestamp (from Kafka) using (Py)Spark Structured Streaming? - null values shown
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM