Field in schemata below relationships but in JSONapi below attributes which results in schema mismatch

Created on 14 January 2025, 3 months ago

Problem/Motivation

We have a field "field_article_seo" which is a Metatag field within a node entity. The jsonapi?_format=json lists the field below relationships (see screenshot), on the resource for the node entity the field is below attributes which causes a schemata mismatch in an external application relying on this.

Schemata JSON

{
  "definitions": {
    "node--article": {
      "properties": {
        "data": {
          "properties": {
            "relationships": {
              "properties": {
                "field_article_seo": {
                  "title": "SEO",
                  "type": "object",
                  "properties": {
                    "...": "..."
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

JSON:API Resource response (/jsonapi/node/article)

{
  "data": [
    {
      "type": "node--article",
      "attributes": {
        "field_article_seo": "{\"title\":\"Test\"}",
      },
      "relationships": {
        // No field_article_seo here
      }
    }
  ]
}

The following versions of modules are used:

  • Entity API: 8.x-1.5
  • JSON:API Extras: 8.x-3.26
  • JSON:API Resources: 8.x-1.2
  • Metatag: 2.0.0
  • OpenAPI: 8.x-2.2
  • OpenAPI for JSON:API: 3.0.5
  • OpenAPI UI: 1.0-rc5
  • Schemata: 1.0.0

Any ideas on this how to get this fixed?

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany sense-design Münster

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024