Skip to content

Question re: collections. #91

@imukai

Description

@imukai

I know from my own reading on the subject that the spec does not allow a collection to be patched by any sort of identifier because it uses JsonPointer instead of JsonPath.

So path = "/collection/{id=434}/property" can't be done. It has to be done by ordinal position. This really is a bad thing if the source collection and patching reference aren't sorted in the same way and the item in the number 3 position might not be the same item in the number 3 position being updated.

I am surprised over the years nobody has done anything about it, at least not that I've been able to find.

My question is how hard would it be to hack in something that could allow an identifier instead of a position?

Probably the correct way of doing this is to not allow it to begin with and have an endpoint for every collection and patch the property through that endpoint. In that case, what is the easiest way of detecting an attempted change to a collection from the root resource patch method so it can be stopped?

Last question since I know you've done some work on this with Core -- are there any notions about changing the JsonPointer to JsonPath in the spec itself moving forward?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions