The format of the data as shown in the screenshot included in your comment is not a valid JSON:API document. A JSON:API document must follow a specific schema as described in the JSON:API specification.
For example the JSON shown in your screenshot validates this requirement of the specification:
A document MUST contain at least one of the following top-level members:
data: the document’s “primary data”
errors: an array of error objects
meta: a meta object that contains non-standard meta-information.
The JSON:API specification contains several examples of well-formed JSON:API documents. I would recommend to have a look at them to understand the specification better.
发布评论
评论(1)
您评论中包含的屏幕截图中所示的数据格式不是有效的JSON:API文档。 JSON:API文档必须遵循
例如,您的屏幕截图中显示的JSON验证了规范的这一要求:
也代表资源的每个对象都违反了JSON:API规范的几个要求,例如:
https://jsonapi.org/format/#document-resource-resource-objects JSON:API规范包含几个形式良好的JSON:API文档的示例。我建议您看看它们,以更好地理解规范。
The format of the data as shown in the screenshot included in your comment is not a valid JSON:API document. A JSON:API document must follow a specific schema as described in the JSON:API specification.
For example the JSON shown in your screenshot validates this requirement of the specification:
Also each object representing a resource violates several requirements of the JSON:API specification, for example:
The JSON:API specification contains several examples of well-formed JSON:API documents. I would recommend to have a look at them to understand the specification better.