From 9be7e7f362e25649c605869ff0b9f1bde5a8d628 Mon Sep 17 00:00:00 2001 From: Keith Hazelton Date: Mon, 28 Jun 2021 15:14:10 -0500 Subject: [PATCH] Update jadn-in-jadn.md --- jadn-in-jadn.md | 285 +++++++++++++++++++++--------------------------- 1 file changed, 127 insertions(+), 158 deletions(-) diff --git a/jadn-in-jadn.md b/jadn-in-jadn.md index 99f7e51..13ad6ae 100644 --- a/jadn-in-jadn.md +++ b/jadn-in-jadn.md @@ -1,158 +1,127 @@ - -$schema "https://json-schema.org/draft/2019-09/schema" -$id "https://oasis-open.org/openc2/jadn/v1.0" -description "Validates structure of a JADN schema, does not check values" -type "object" -required -0 "types" -additionalProperties false -properties -info -type "object" -required -0 "package" -additionalProperties false -properties -package -type "string" -version -type "string" -title -type "string" -description -type "string" -comment -type "string" -copyright -type "string" -license -type "string" -namespaces -$ref "#/definitions/Namespaces" -exports -$ref "#/definitions/Exports" -config -$ref "#/definitions/Config" -types -type "array" -items -type "array" -minItems 2 -maxItems 5 -items -0 -$ref "#/definitions/TypeName" -1 -$ref "#/definitions/BaseType" -2 -$ref "#/definitions/Options" -3 -$ref "#/definitions/Description" -4 -$ref "#/definitions/Fields" -definitions -Namespaces -type "object" -propertyNames -$ref "#/definitions/NSID" -patternProperties - -type "string" -format "uri" -Exports -type "array" -items -type "string" -Config -type "object" -additionalProperties false -properties -$MaxBinary -type "integer" -minValue 1 -$MaxString -type "integer" -minValue 1 -$MaxElements -type "integer" -minValue 1 -$Sys -type "string" -minLength 1 -maxLength 1 -$TypeName -type "string" -minLength 1 -maxLength 127 -$FieldName -type "string" -minLength 1 -maxLength 127 -$NSID -type "string" -minLength 1 -maxLength 127 -Fields -type "array" -items -0 -anyOf -0 -$ref "#/definitions/Item" -1 -$ref "#/definitions/Field" -Item -type "array" -minItems 2 -maxItems 3 -items -0 -type "integer" -1 -type "string" -2 -$ref "#/definitions/Description" -Field -type "array" -minItems 3 -maxItems 5 -items -0 -type "integer" -1 -$ref "#/definitions/FieldName" -2 -$ref "#/definitions/TypeRef" -3 -$ref "#/definitions/Options" -4 -$ref "#/definitions/Description" -NSID -type "string" -TypeName -type "string" -TypeRef -type "string" -FieldName -type "string" -BaseType -type "string" -enum -0 "Binary" -1 "Boolean" -2 "Integer" -3 "Number" -4 "String" -5 "Enumerated" -6 "Choice" -7 "Array" -8 "ArrayOf" -9 "Map" -10 "MapOf" -11 "Record" -Options -type "array" -items -type "string" -Description -type "string" +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "https://oasis-open.org/openc2/jadn/v1.0", + "description": "Validates structure of a JADN schema, does not check values", + "type": "object", + "required": ["types"], + "additionalProperties": false, + "properties": { + "info": { + "type": "object", + "required": ["package"], + "additionalProperties": false, + "properties": { + "package": {"type": "string"}, + "version": {"type": "string"}, + "title": {"type": "string"}, + "description": {"type": "string"}, + "comment": {"type": "string"}, + "copyright": {"type": "string"}, + "license": {"type": "string"}, + "namespaces": {"$ref": "#/definitions/Namespaces"}, + "exports": {"$ref": "#/definitions/Exports"}, + "config": {"$ref": "#/definitions/Config"} + } + }, + "types": { + "type": "array", + "items": { + "type": "array", + "minItems": 2, + "maxItems": 5, + "items": [ + {"$ref": "#/definitions/TypeName"}, + {"$ref": "#/definitions/BaseType"}, + {"$ref": "#/definitions/Options"}, + {"$ref": "#/definitions/Description"}, + {"$ref": "#/definitions/Fields"} + ] + } + } + }, + "definitions": { + "Namespaces": { + "type": "object", + "propertyNames": {"$ref": "#/definitions/NSID"}, + "patternProperties": { + "": { + "type": "string", + "format": "uri" + } + } + }, + "Exports": { + "type": "array", + "items": {"type": "string"} + }, + "Config": { + "type": "object", + "additionalProperties": false, + "properties": { + "$MaxBinary": {"type": "integer", "minValue": 1}, + "$MaxString": {"type": "integer", "minValue": 1}, + "$MaxElements": {"type": "integer", "minValue": 1}, + "$Sys": {"type": "string", "minLength": 1, "maxLength": 1}, + "$TypeName": {"type": "string", "minLength": 1, "maxLength": 127}, + "$FieldName": {"type": "string", "minLength": 1, "maxLength": 127}, + "$NSID": {"type": "string", "minLength": 1, "maxLength": 127} + } + }, + "Fields": { + "type": "array", + "items": [ + {"anyOf": [ + {"$ref": "#/definitions/Item"}, + {"$ref": "#/definitions/Field"} + ]} + ] + }, + "Item": { + "type": "array", + "minItems": 2, + "maxItems": 3, + "items": [ + {"type": "integer"}, + {"type": "string"}, + {"$ref": "#/definitions/Description"} + ] + }, + "Field": { + "type": "array", + "minItems": 3, + "maxItems": 5, + "items": [ + {"type": "integer"}, + {"$ref": "#/definitions/FieldName"}, + {"$ref": "#/definitions/TypeRef"}, + {"$ref": "#/definitions/Options"}, + {"$ref": "#/definitions/Description"} + ] + }, + "NSID": { + "type": "string" + }, + "TypeName": { + "type": "string" + }, + "TypeRef": { + "type": "string" + }, + "FieldName": { + "type": "string" + }, + "BaseType": { + "type": "string", + "enum": ["Binary", "Boolean", "Integer", "Number", "String", + "Enumerated", "Choice", + "Array", "ArrayOf", "Map", "MapOf", "Record"] + }, + "Options": { + "type": "array", + "items": {"type": "string"} + }, + "Description": { + "type": "string" + } + } +}