Skip to content

feat: patch/put on IRIs with custom ids. #5687

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

Closed
wants to merge 1 commit into from

Conversation

mrossard
Copy link
Contributor

@mrossard mrossard commented Jul 24, 2023

Q A
Branch? 3.1

Somewhat related to #5645

This is not really a PR, I'm mostly aiming to start a discussion on how to find a more "framework-wide" way to resolve such issues (even if this simplistic version does fix one use case).

I feel like the underlying problem i'm trying to tackle here is actually caused by an unclear differenciation between various close but not always related notions in APIP:

  • uriVariables
  • ApiResource identifiers
  • ORM (or other backend) identifiers

Those are often the "same thing" in a "standard" app (i.e. the id column of the entity is the api resource identifier and is used as is in the uri template), but that's not always what api deisgners want.
I think the framework would gain a lot of clarity at various places by keeping those notions separate and making them available all around. The IdentifiersExtractor comes close, but as you can see from this PR it doesn't handle some "complex" cases as it is right now.

Am I the only one feeling that way? And if not, what would a good way to do this be? A few months back while talking to @soyuka I mentioned I thought some kind of "State" object would make a lot of sense to replace uriVariables / some of the stuff that ends up in $context, I still think that could help building a "clean" solution.

@Aerendir
Copy link
Contributor

Aerendir commented Aug 9, 2023

I don't have a possible solution, but this comment is just to express my support for the discussion: it is a really important one in my opinion.

@soyuka
Copy link
Member

soyuka commented Aug 14, 2023

can #5732 work for that kind of use cases as well ?

@mrossard
Copy link
Contributor Author

can #5732 work for that kind of use cases as well ?

I'm not sure, this problem is not about linking to other entities, but mostly about using put/patch on entities when their ORM id is not in uriVariables. Currently APIP tries to create a new entity instead of updating it.

That being said it's somewhat related, my "solution" being to add some ORM specific metadata to specify which fields are ORM ids that shouldn't be updated.

@stale
Copy link

stale bot commented Oct 19, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 19, 2023
@mrossard
Copy link
Contributor Author

just a note to remind myself to check this with 3.2

@stale stale bot removed the stale label Oct 19, 2023
Copy link

stale bot commented Dec 18, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 18, 2023
@mrossard
Copy link
Contributor Author

Still not giving this up, just not finding any time to work on APIP right now...

@stale stale bot removed the stale label Dec 19, 2023
@soyuka
Copy link
Member

soyuka commented Dec 19, 2023

I just fixed that I think #6019

@soyuka soyuka closed this Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants