Skip to content
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

Note about PUT/PATCH in introduction § #1725

Merged
merged 1 commit into from
Feb 22, 2023

Conversation

Nayte91
Copy link
Contributor

@Nayte91 Nayte91 commented Feb 22, 2023

I didn't see the note and spent a lot of time figuring out what happens, because I was trying to Upload to an Existing Resource, and the note is not in this chapter. So I think it deserves to belong in the introduction paragraph.

I didn't see the note and spent a lot of time figuring out what happens, because I was trying to Upload to an Existing Resource, and the note is not in this chapter.
So I think it deserves to belong in the introduction paragraph.
@alanpoulain
Copy link
Member

I'm not sure changing its place would solve the issue. IMO the issue is more "graphical": we don't have a way to highlight a note like the Symfony documentation.

@Nayte91
Copy link
Contributor Author

Nayte91 commented Feb 22, 2023

By my experience, yesterday evening:

  • Searched how to upload a file without exposing a new resource and found this page,
  • Went directly to the "Uploading to an Existing Resource with its Fields" chapter without reading the "Uploading to a Dedicated Resource" one,
  • Tried to achieve it and tested code with some PATCH requests on my existing Entity,
  • Table flipped after 2 hours (╯°□°)╯︵ ┻━┻ ,
  • Looked at it today,
  • Found this very important note in the other chapter,
  • Wrote this fix in approximately 45 seconds.

It's pretty straightforward, and as I don't think I made a major mistake by skipping an optional chapter, I still argue that this note must be in the introductory remarks rather than in a skippable section;

Unless I am mistaken, the note applies to all PUT/PATCH requests with a file to upload, not only if the upload is done to a dedicated resource. I would say ESPECIALLY when you try to upload a file to an existing resource; It's easy to deal only with POST and DELETE on a dedicated resource, but on a existing one, not having PUT & PATCH is overwhelming.

But I also agree that docs may need an icon for important notes :)

@alanpoulain
Copy link
Member

Alright 🙂

@alanpoulain alanpoulain merged commit c9adccd into api-platform:3.1 Feb 22, 2023
@Nayte91 Nayte91 deleted the patch-1 branch February 22, 2023 15:47
SiMoeBoe pushed a commit to SiMoeBoe/api-platform_docs that referenced this pull request Sep 24, 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.

None yet

2 participants