|
Post by hramasub on Feb 27, 2017 12:54:33 GMT
How does a generic client validate the response returned by the server ?
i.e. how does the client identify the schema against which the response must be validated ?
The URI in the Service Metadata document refers to the XML file and not the json file.
So, how is the path to the .json schema file for a given resource determined?
|
|
|
Post by jautor on Feb 27, 2017 20:20:07 GMT
The JSON Schema file that defines the resource can be determined from the @odata.type returned in the payload.
The filename will be portion of the @odata.type after the hash and up to the last period. Example: for @odata.type of "#Chassis.v1_2_0.Chassis", the corresponding JSON schema file will be "Chassis.v1_2_0.json". Within the JSON schema file, the "title" will match the @data.type exactly.
Note that the JSON schema files may be accessible through the Redfish Service implementation - if there is a "JsonSchemas" collection, it can contain links to local or remote copies of the schema files.
They can also be accessed from the official DMTF Redfish Schema Repository at: redfish.dmtf.org/schemas Note that your schema-aware application should cache these files locally to avoid requirements for Internet access (and avoid latency and load on the server!).
Jeff
|
|
|
Post by hramasub on Mar 1, 2017 5:31:25 GMT
The @odata.type property does _not_ provide the URL prefix. How does a client determine the URL prefix for the schemas: e.g. for DMTF schema: redfish.dmtf.org/schemas/ for OEM schema : www.contoso.com/redfish/schemas/"JsonSchemas" collection is _not_ a resource defined in the Redfish specification. Hence, a service implementation will have to define an OEM schema for that ? This appears to be a _cyclic dependency_. Do you have a suggestion to implement Jsonschemas collection without having to define an OEM schema for it?
|
|
|
Post by mraineri on Mar 6, 2017 15:59:15 GMT
Within ServiceRoot, there is a navigation property named "JsonSchemas"; if a service has implemented it, it can advertise the JSON schemas in that link. The members of that collection are all of type JsonSchemaFile, which in turn contains the URLs to the individual JSON files as well as the Schema name (such as Chassis.V1_2_0.Chassis).
|
|
|
Post by AMI_shirleyh on Feb 7, 2023 8:19:17 GMT
Hi,
Should we add only the local OEM defined Schemas under "JsonSchemas" or is it advisable to include all the standard schema's also under "JsonSchemas" ?
Thanks Shirley
|
|
|
Post by mraineri on Feb 7, 2023 13:29:14 GMT
Both would be good for the sake of completeness and transparency with the client.
|
|
|
Post by AMI_shirleyh on Feb 8, 2023 12:08:08 GMT
Thanks
|
|