Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relationship-meta example incorrectly shows link-meta instead of relationship-meta #5969

Closed
oliverlangan opened this issue Apr 5, 2019 · 3 comments
Labels
🏷️ doc This PR adds/improves/or fixes documentation

Comments

@oliverlangan
Copy link

The example for DS.Reference#meta shows a metadata block as a descendant of the links object, which does not actually work.

relationships: {
  user: {
    links: {
      related: {
        href: '/articles/1/author',
        meta: {
          lastUpdated: 1458014400000
        }
      }
    }
  }
}

According to the JSON:API spec, meta is allowed as a sibling/alternative to links. This actually works in Ember Data using model.hasMany(relationship).meta(), so the example should be updated:

relationships: {
  user: {
    links: {
      related: '/articles/1/author',
    },
    meta: {
      lastUpdated: 1458014400000
    }
  }
}
@oliverlangan
Copy link
Author

A coworker pointed out that the metadata shown in the docs is indeed valid JSON:API syntax. However, this is still a valid issue because the meta method does not return that information.

@runspired
Copy link
Contributor

@oliverlangan right, meta method is for the relationship-meta, not the link-meta

@runspired runspired changed the title metadata example is incorrect, does not work or follow JSON:API spec relationship-meta example incorrect shows link-meta instead of relationship-meta Apr 8, 2019
@runspired runspired changed the title relationship-meta example incorrect shows link-meta instead of relationship-meta relationship-meta example incorrectly shows link-meta instead of relationship-meta Apr 8, 2019
@snewcomer
Copy link
Contributor

This can be closed!

@runspired runspired added 🏷️ doc This PR adds/improves/or fixes documentation and removed Documentation labels Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ doc This PR adds/improves/or fixes documentation
Projects
None yet
Development

No branches or pull requests

3 participants