如何设置JSON Schema规则以确定必须设置其中一个属性并且是必需的?
我尝试了各种方法来解决它:
{
"id":"#",
"required":true,
"additionalProperties":true,
"type":"object",
"properties":{
"surname":{
"id":"surname",
"required":true,
"type":"string"
},
"oneOf":[
{
"$ref":"#/definitions/station_id"
},
{
"$ref":"#/definitions/station"
}
]
},
"definitions":{
"station_id":{
"type":"integer"
},
"station":{
"type":"string"
}
}
}
Run Code Online (Sandbox Code Playgroud)
但它从来没有奏效.我需要做的是接受station_id什么是整数或者什么是字符串名称.
请问有办法吗?
我有一个数据表,我想过滤列。例如,按用户的全名搜索用户。
\n但是,我希望允许用户输入搜索短语时不区分大小写和重音。
\n所以我检查了这些(以及更多)来源和问题:
\n我认为非确定性排序规则可能最终是实现这一目标的正确方法,但不幸的是我不知道如何:
\n对于如何最终处理此类问题的任何建议,我将非常感激。
\n谢谢!
\n我的输入旁边有一个长标签,它没有垂直对齐.
是否有一些选项可以像在Bootstrap 2中那样解决它,好吗?
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="input1" class="col-lg-2 control-label">Labdas kjas kljas dlkjasd lksjd el1</label>
<div class="col-lg-10">
<input type="text" class="form-control" id="input1" placeholder="Input1">
</div>
</div>
<div class="form-group">
<label for="input2" class="col-lg-2 control-label">Label2</label>
<div class="col-lg-10">
<input type="password" class="form-control" id="input2" placeholder="Input2">
</div>
</div>
</form>
Run Code Online (Sandbox Code Playgroud)