Git Product home page Git Product logo

Comments (3)

wopian avatar wopian commented on August 28, 2024 1

As for example 2, it seems you encounter an issue when trying to delete a single link in a to-many relationship?
If i'm to interpret the specification, it seems like to-many relationships must supply an array when issuing a DELETE request:

https://jsonapi.org/format/1.2/#crud-updating-to-many-relationships

the client makes a DELETE request to a URL from a relationship link the server MUST delete the specified members from the relationship

Going by the wording, i would say its reasonable to expect the users of Kitsu to supply the argument for api.delete as an array, rather than implementing logic for checking the supplied URL and performing modifications to the body.

I'm happy to PR the changes to the documentation to make this clearer, or add the logic to the delete implementation, but i think @wopian should have final say in whether its within kitsu's scope to include this logic.

You're correct here, which was likely an oversight from me when initialy writing the documentation - the PATCH documentation has its respective equivalents already.

The documentation for api.delete(resource, [123]) should really have had two documentation entries instead of just:

Remove multiple resources (API must support the Bulk Extension)

If you would like to add a PR that adds the following example, that would be great 👍

Remove relationship(s) from a resource
api.delete('posts/relationships/authors', [ 1, 2 ])

I would perhaps put it above the Bulk Extension delete example as that appears to still be an extension-only behaviour in JSON:API 1.1 too.

from kitsu.

pedep avatar pedep commented on August 28, 2024

Your first example looks to be a simple mistake in the docs, which #782 will fix

As for example 2, it seems you encounter an issue when trying to delete a single link in a to-many relationship?
If i'm to interpret the specification, it seems like to-many relationships must supply an array when issuing a DELETE request:

https://jsonapi.org/format/1.2/#crud-updating-to-many-relationships

If the client makes a DELETE request to a URL from a relationship link the server MUST delete the specified members from the relationship

Going by the wording, i would say its reasonable to expect the users of Kitsu to supply the argument for api.delete as an array, rather than implementing logic for checking the supplied URL and performing modifications to the body.

I'm happy to PR the changes to the documentation to make this clearer, or add the logic to the delete implementation, but i think @wopian should have final say in whether its within kitsu's scope to include this logic.

from kitsu.

wopian avatar wopian commented on August 28, 2024

Documentation updated in 10.0.3 (2022-10-30)

from kitsu.

Related Issues (20)

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.