diff options
author | a.sreekumar <ajith.sreekumar@bell.ca> | 2022-07-19 11:49:57 +0100 |
---|---|---|
committer | a.sreekumar <ajith.sreekumar@bell.ca> | 2022-07-20 13:10:04 +0100 |
commit | c354fba3fb87ebe21a7fbb2a15268ccc9d033fbd (patch) | |
tree | 5c2efa9ef3158d1141aca2a5ed37ecf72b369d2c /plugins/plugins-context/plugins-context-schema/plugins-context-schema-json/src/test/resources/schema | |
parent | 9e70ba9dc8d5b8e6f254354180b00d29a3fc7a1a (diff) |
Adding JSON Schema support in APEX-PDP
More details can be found here:
https://wiki.onap.org/display/DW/JSON+Schema+support+in+APEX-PDP
A separate review will be raised as part of POLICY-4292 with a reference
example on how to use the JSON Schema.
Change-Id: I903d48969c6c5a24c63b8465b2412ed0b75b9351
Issue-ID: POLICY-4291
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
Diffstat (limited to 'plugins/plugins-context/plugins-context-schema/plugins-context-schema-json/src/test/resources/schema')
4 files changed, 160 insertions, 0 deletions
diff --git a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-json/src/test/resources/schema/commonHeaderTypeWithOptional.json b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-json/src/test/resources/schema/commonHeaderTypeWithOptional.json new file mode 100644 index 000000000..d8d994fda --- /dev/null +++ b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-json/src/test/resources/schema/commonHeaderTypeWithOptional.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "requestId": { + "type": "string" + }, + "subRequestId": { + "type": "string" + }, + "originatorId": { + "type": "string" + }, + "testId": { + "type": "integer" + } + }, + "required": [ + "requestId", + "subRequestId", + "originatorId" + ] +} diff --git a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-json/src/test/resources/schema/commonHeaderType_draft04.json b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-json/src/test/resources/schema/commonHeaderType_draft04.json new file mode 100644 index 000000000..de1c05b6f --- /dev/null +++ b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-json/src/test/resources/schema/commonHeaderType_draft04.json @@ -0,0 +1,24 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "requestId": { + "type": "string" + }, + "subRequestId": { + "type": "string" + }, + "originatorId": { + "type": "string" + }, + "testId": { + "type": "number" + } + }, + "required": [ + "requestId", + "subRequestId", + "originatorId", + "testId" + ] +} diff --git a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-json/src/test/resources/schema/commonHeaderType_draft07.json b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-json/src/test/resources/schema/commonHeaderType_draft07.json new file mode 100644 index 000000000..94558ffe5 --- /dev/null +++ b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-json/src/test/resources/schema/commonHeaderType_draft07.json @@ -0,0 +1,52 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Root", + "type": "object", + "required": [ + "requestId", + "subRequestId", + "originatorId", + "testId" + ], + "properties": { + "requestId": { + "$id": "#root/requestId", + "title": "Requestid", + "type": "string", + "default": "", + "examples": [ + "123456-1000" + ], + "pattern": "^[0-9]*-[0-9]*$" + }, + "subRequestId": { + "$id": "#root/subRequestId", + "title": "Subrequestid", + "type": "string", + "default": "", + "examples": [ + "sub-123456-1000" + ], + "pattern": "^.*$" + }, + "originatorId": { + "$id": "#root/originatorId", + "title": "Originatorid", + "type": "string", + "default": "", + "examples": [ + "sdnc" + ], + "pattern": "^.*$" + }, + "testId": { + "$id": "#root/testId", + "title": "Testid", + "type": "number", + "examples": [ + 212.2 + ], + "default": 0 + } + } +} diff --git a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-json/src/test/resources/schema/measurementGroupsType.json b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-json/src/test/resources/schema/measurementGroupsType.json new file mode 100644 index 000000000..41e598f93 --- /dev/null +++ b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-json/src/test/resources/schema/measurementGroupsType.json @@ -0,0 +1,61 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "array", + "default": [], + "items": { + "type": "object", + "required": [ + "measurementGroup" + ], + "properties": { + "measurementGroup": { + "type": "object", + "required": [ + "measurementTypes" + ], + "properties": { + "measurementTypes": { + "type": "array", + "default": [], + "items": { + "type": "object", + "required": [ + "measurementType" + ], + "properties": { + "measurementType": { + "type": "string", + "default": "", + "examples": [ + "countera" + ], + "pattern": "^.*$" + } + } + } + }, + "managedObjectDNsBasic": { + "type": "array", + "default": [], + "items": { + "type": "object", + "required": [ + "DN" + ], + "properties": { + "DN": { + "type": "string", + "default": "", + "examples": [ + "dna" + ], + "pattern": "^.*$" + } + } + } + } + } + } + } + } +} |