diff --git a/System/json_schema/ec32/ecschema-format.schema.json b/System/json_schema/ec32/ecschema-format.schema.json new file mode 100644 index 000000000..895e5af87 --- /dev/null +++ b/System/json_schema/ec32/ecschema-format.schema.json @@ -0,0 +1,105 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "https://dev.bentley.com/json_schemas/ec/32/format", + "title": "Format", + "description": "An EC3.2 Json representation of a Format SchemaItem", + "type": "object", + "required": ["name", "precision", "type"], + "allOf": [ + { + "type": "object", + "properties": { + "name": { "$ref": "https://dev.bentley.com/json_schemas/ec/32/schemaitem#/definitions/ecname" }, + "description": { "type": "string" }, + "displayLabel": { "type": "string" } + } + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["decimal", "fractional", "station", "scientific"] + }, + "precision": { + "type": "number", + "// TODO Update pattern": "" + }, + "roundFactor": { + "type": "number" + }, + "minWidth": { + "type": "integer", + "minimum": 0 + }, + "showSignOption": { + "type": "string", + "enum": ["noSign", "onlyNegative", "signAlways", "negativeParentheses"] + }, + "formatTraits": { + "oneOf": [ + { + "type": "string", + "pattern": "(trailZeroes|keepSingleZero|zeroEmpty|keepDecimalPoint|applyRounding|fractionDash|showUnitLabel|prependUnitLabel|use1000Separator|exponentOnlyNegative|[,|;])+" + }, + { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": ["trailZeroes", "keepSingleZero", "zeroEmpty", "keepDecimalPoint", "applyRounding", "fractionDash", "showUnitLabel", "prependUnitLabel", "use1000Separator", "exponentOnlyNegative"] + } + } + ] + }, + "decimalSeparator": { + "type": "string", + "maxLength": 1 + }, + "thousandSeparator": { + "type": "string", + "maxLength": 1 + }, + "uomSeparator": { + "type": "string", + "maxLength": 1 + }, + "scientificType": { + "type": "string", + "enum": ["normalized", "zeroNormalized"] + }, + "stationOffsetSize": { + "type": "number", + "minimum": 0 + }, + "stationSeparator": { + "type": "string", + "maxLength": 1 + }, + "composite": { + "type": "object", + "properties": { + "spacer": { + "type": "string" + }, + "includeZero": { + "type": "boolean" + }, + "units": { + "type": "array", + "minItems": 1, + "maxItems": 4, + "items": { + "type": "object", + "properties": { + "name": { "$ref": "https://dev.bentley.com/json_schemas/ec/32/schemaitem#/definitions/ecname" }, + "label": { "type": "string" } + } + } + } + } + } + } + } + ] +} diff --git a/System/json_schema/ec32/ecschema-item.schema.json b/System/json_schema/ec32/ecschema-item.schema.json index 4a0eaee8c..5428e662c 100644 --- a/System/json_schema/ec32/ecschema-item.schema.json +++ b/System/json_schema/ec32/ecschema-item.schema.json @@ -394,127 +394,6 @@ ] }, "UnitSystem": { "$ref": "#/definitions/schemaItemProperties"}, - "Format": { - "type": "object", - "required": [ - "precision", - "type" - ], - "allOf": [ - { "$ref": "#/definitions/schemaItemProperties" }, - { - "type":"object", - "properties": { - "type": { - "type": "string", - "enum": [ - "decimal", - "fractional", - "station", - "scientific" - ] - }, - "precision": { - "type": "number", - "// TODO Update pattern": "" - }, - "roundFactor": { - "type":"number" - }, - "minWidth": { - "type":"integer", - "minimum": 0 - }, - "showSignOption": { - "type": "string", - "enum": [ - "noSign", - "onlyNegative", - "signAlways", - "negativeParentheses" - ] - }, - "formatTraits": { - "oneOf": [ - { - "type": "string", - "pattern": "(trailZeroes|keepSingleZero|zeroEmpty|keepDecimalPoint|applyRounding|fractionDash|showUnitLabel|prependUnitLabel|use1000Separator|exponentOnlyNegative|[,|;])+" - }, - { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "trailZeroes", - "keepSingleZero", - "zeroEmpty", - "keepDecimalPoint", - "applyRounding", - "fractionDash", - "showUnitLabel", - "prependUnitLabel", - "use1000Separator", - "exponentOnlyNegative" - ] - } - } - ] - }, - "decimalSeparator": { - "type": "string", - "maxLength": 1 - }, - "thousandSeparator": { - "type": "string", - "maxLength": 1 - }, - "uomSeparator": { - "type": "string", - "maxLength": 1 - }, - "scientificType": { - "type": "string", - "enum": [ - "normalized", - "zeroNormalized" - ] - }, - "stationOffsetSize": { - "type": "number", - "minimum": 0 - }, - "stationSeparator": { - "type": "string", - "maxLength": 1 - }, - "composite": { - "type": "object", - "properties": { - "spacer": { - "type": "string" - }, - "includeZero": { - "type": "boolean" - }, - "units": { - "type": "array", - "minItems": 1, - "maxItems": 4, - "items": { - "type": "object", - "properties": { - "name": { "$ref": "#/definitions/ecname" }, - "label": { "type": "string" } - } - } - } - } - } - } - } - ] - }, "primitiveTypes": { "type": "string", "enum": [ @@ -646,6 +525,6 @@ {"$ref": "#/definitions/Constant"}, {"$ref": "#/definitions/Phenomenon"}, {"$ref": "#/definitions/UnitSystem"}, - {"$ref": "#/definitions/Format"} + {"$ref": "https://dev.bentley.com/json_schemas/ec/32/format#"} ] } \ No newline at end of file