In many Json schemas there is "format" property, e.g in the UpdateService.v1_5_1.json in the MaintenanceWindowStartTime there is "format": "date-time", in the Chassis.v1_6_4.json in the definition of "Reset" there is "format": "uri-reference"
I should also note that the "redfish-schema" file is an extension of the core JSON Schema vocabulary; since "$schema" has the value "http://json-schema.org/draft-07/schema#", this pulls in the referenced core JSON Schema definitions. This is where things like "format", "definitions", "properties", and other JSON Schema terms are defined.
Hi, I was also a little confused about this, as it is not very easy to find why "format" is used in json schema. (mraineri gives good description above about where it is defined). But I think that reason for using the "format" is likely in how CSDL schema files are translated to JSON schema files, but these parts I don´t think can be found in the specification document? (The CSDL files should be the origin and they are translated to JSON and openapi files.) Primitive data types (in CSDL files) are defined in specification (v 1.8.0) chapter 188.8.131.52, including type Edm.DateTimeOffeset, which I assume translate into some JSON string type but with "format": "date-time" added? And "format": "uri-reference" in JSON should in similar way originate from CSDL annotation term "OData.IsURL"? I hope that someone could confirm if this is correct or not.. I also think that this kind of mapping from CDSL to JSON could possibly be added to chapter 11.2 (JSON schema) in the specification to make it more clear? BR /Magnus
That's correct, the conversion tool will fill in "format" based on a few different things: - If the type is "Edm.DateTimeOffset", put in "date-time" - If the property contains "OData.IsURL", or is the "target" property in an action, put in "uri-reference" - If the property contains "Validation.Pattern", copy the pattern into "format"
We've definitely been behind with keeping the spec up to date with all of the terms we've been using in schema. I think it would be a good idea to add this an other terms that may be missing. It would go in both sections 9.2 (the general schema annotation listing) and section 11 (how they're used in the different schema languages).