|
Post by shiraez on Oct 5, 2021 14:05:44 GMT
I'm trying to add a Link header to our server.
I generate it using "@odata.type". for example:
Link: <http://redfish.dmtf.org/schemas/Drive.v1_9_0.json>
I don't understand how to a add link to "$metadata". Do I need to add a link for it? if so, what should it be?
|
|
|
Post by mraineri on Oct 5, 2021 16:54:05 GMT
The "Link" header is used so that a JSON Schema-based client is able to locate the schema definition of the resource. $metadata is only a necessity for OData-based clients.
The thing to keep in mind with Redfish is it's designed around supporting various types of clients built upon different schema languages. So, an OData-based client will reference $metadata And @odata.type to look up resource definitions, whereas JSON Schema-based clients will use the Link header to discover resource definitions. $metadata is its own URI (/redfish/v1/$metadata) to which clients can perform an HTTP GET operation for getting the CSDL references; there is no tie to the Link header for CSDL definitions.
|
|
|
Post by mraineri on Oct 5, 2021 16:57:20 GMT
If the question is rather what goes into the Link header in the response to a GET operation on /redfish/v1/$metadata, then for that particular case you do not need a Link header. I can see how the existing wording in the specification might not be clear enough, and I think we can make a fix to clarify it's intended for resource responses, meaning /redfish/v1/$metadata is exempt from that requirement.
|
|