Comments (3)
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.
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.
Documentation updated in 10.0.3 (2022-10-30)
from kitsu.
Related Issues (20)
- Error: Request failed with status code 404 HOT 1
- kitsu module not found HOT 3
- return the headers with GET respose HOT 2
- JSDoc comment for `deserialise()` is inconsistent with implementation HOT 6
- Nested same relationships does not deserialize as expected HOT 9
- [object Object] is not an Option Object when defining query parameters in Vue setup context HOT 6
- Serializing an object with a relationship is not JSONAPI compliant HOT 3
- Additional axios config options in the config for all operations
- Object type checking might fail in nuxt applications HOT 5
- Dependency Dashboard
- Issue in Deserialize function: `meta` object is getting overwritten if the same reference is used multiple places. HOT 1
- Cannot call create without attributes HOT 2
- Character api HOT 1
- Deserialise method misses meta (meta: undefined) in case of relationships with links and data HOT 1
- Question: how to detect relationships HOT 4
- Sunsetting Node 14 and 16 support HOT 5
- Adding a custom scrollbar to the webpage HOT 2
- Feature: Scroll to top HOT 3
- Issue with types HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kitsu.