-
Notifications
You must be signed in to change notification settings - Fork 57
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
Resource creation behaviour when using the Slug
header
#96
Comments
That sounds like useful non-normative material. Irrespective of
Servers can implement that recommendation by prohibiting any attempts to update existing resources - The exact application of |
Yup, definitly. Should we put it on the June milestone? |
Thinking further.. While servers can choose to handle If servers runs into the URI reuse case, it should reject the request instead of creating a resource with a different name. It gives clients the opportunity to be aware of an existing resource with the same name, and resolve the conflict eg. try a different FWIW:
as opposed to creating for example Moreover, it is worthwhile to note server's environment for security and privacy purposes. That is, if the server returns a |
#107 should be resolved before resolving this issue. Will probably reuse heuristics. |
When rereading this issue, I found that there two separate issues that fit pretty well with the headline, but not with the description of @NSeydoux . :-) One is what should be done when there is an existing resource with the same identifier. The other is how the |
Servers using the Slug value in the algorithm to generate the new URI SHOULD apply the slash semantics. |
Given #128 (comment), we might want that to be a MUST. |
I think Best Practices note could include guidance on using Slug header. Since client can't rely on server honoring it, probably creating new resource with PUT provides way for client to ensure creation at specific IRI. I think someone developing client may prefer to use reliable PUT than handle case where client hints certain slug but server ignores it. |
This comment has been minimized.
This comment has been minimized.
I tried suggesting use of PUT as best practice to create new resource at specific IRI, instead of POST + Slug. This way client will simply not need to deal with server ignoring the Slug. |
This comment has been minimized.
This comment has been minimized.
Yes, I think we agree on that, but note that the original issue text is about what to do when there are existing resources. Perhaps a change of title would clarify? How about "Behaviour of Slug header when it would collide with an existing resource with the same identifier." Or something like that. What do you think, @NSeydoux ? |
The title you're proposing is basically #107 with the use of Slug. The effective request URI will be processed all the same with or without Slug. |
In the current LDP specification, a client is allowed to hint for a resource name at creation time by setting the
Slug
header in thePOST
request (see section 5.2.3.10). However, since the usage of theSlug
header is quite flexible, the LDP spec does not specify the expected behaviour when requesting for the creation of a resource with a slug that's already present in the parent's containments.Depending on the implementation, different behaviours may therefore be expected:
409 Conflict
response to the client, potentially including aLink <iri>; rel="ldp:constrainedBy"
header, witiri
pointing to a vocabulary defining a term specifying "The requested IRI already exists"Location
headerSince these two behaviours are compliant by the LDP spec, I don't know if imposing one over the other is desirable in the Solid spec, but it may be worth mentioning that these outcomes are possible in the LDP section of the Solid spec, as a non-normative remark.
Do you think this needs to be addressed, and if so as a normative or a non-normative bit ?
The text was updated successfully, but these errors were encountered: