Git Product home page Git Product logo

Comments (3)

lindyhopchris avatar lindyhopchris commented on June 26, 2024

"at least one of the following" does mean that it can have just one of data, links and meta.

from spec.

lindyhopchris avatar lindyhopchris commented on June 26, 2024

I must apologise - I completely misread this issue when you opened it! I hadn't taken in it was in the laravel-json-api/spec repo.

So the part of the spec that is relevant here says this:

[When creating a resource] If a relationship is provided in the relationships member of the resource object, its value MUST be a relationship object with a data member. The value of this key represents the linkage the new resource is to have.
https://jsonapi.org/format/#crud-creating

And for updating:

If a relationship is provided in the relationships member of a resource object in a PATCH request, its value MUST be a relationship object with a data member. The relationship’s value will be replaced with the value specified in this member.
https://jsonapi.org/format/#crud-updating

The section you've quoted is about the serialization of a relationship within a resource object, i.e. when a server is serializing a resource.

from spec.

yaviso avatar yaviso commented on June 26, 2024

I'm sorry, you are complete correct... Guess now I'll have to see how I get my client lib to not serialize relationships for PATCH/POST when there is no data available (but links is)...

from spec.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.