0
アプリケーションが別のものに送信する必要がある各メッセージをフォーマットするために、Jsonスキーマを構築する必要があります。プロパティ値に応じて値を要求する
私はすでにこの構築:私は、コマンドは「読み」するsettedされている場合
- :今のところ
{ 'description': 'BLABLA', 'definitions': { 'M2M_message_input' : { 'type' : 'object', 'properties' : { 'command' : { 'type': 'string', 'enum' : ['read', 'write', 'list', 'reset priority'] }, 'path' : { 'type' : 'string', 'pattern' : '^\/' }, 'value' : {'type' : 'string'}, 'priority' : { 'type' : 'integer', 'maximum' : 255, 'exclusiveMaximum' : false, 'minimum' : 0, 'exclusiveMinimum' : false } }, 'required': ['command'], 'dependencies' : { 'value' : ['priority'] }, "additionalProperties" : false } }, 'type': 'object', '$ref' : '#/definitions/M2M_message_input' }
を、私のような指令値に応じて、いくつかのプロパティを、必要とする場合、コマンドが「書き込み」にsettedされている場合、私はパスを要求したい
- 、パスを必要とする値と優先順位
など...
JSON Schema - specify field is required based on value of another fieldのようないくつかの話題がありましたが、私の場合はv4のドラフトでは対応できませんでした。
提案がありますか?