-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Response code for POST method should be 201 not 200 #788
Comments
Thanks to reactivate this important point ! |
I think this has two parts:
|
hi team, we are upgrading from swagger2 to openapi3, PR is ready for it #916 |
Does the alteration to the responseObject formatting change the logic required to handle the return code in some way? I would've expected that the sequence would simply handle the success of a POST with a 201 code in the same way for v2 and v3; that is, I'd expect a property with the same name (probably |
@kjdelisle good point, honestly I am not sure, and due to the effort needed in v2-v3, see comment:#753 (comment), the PR won't be landed in a few days, so no sense to block this story :) |
@kjdelisle and me decided this does not really belong to MVP/Walking Skeleton. |
So, can you give a status of this issue please ? can we expect a fix on 4.x ? |
Marking the item as non-MVP doesn't mean that we won't be doing it for the 4.x release, it just means that it's not a part of our initial push to get the framework into a stable state. Our goal with the idea of MVP is that we want the framework to be in a position where:
The MVP is not the final release! It's an interim state between the constant flux of alpha and the near-completeness of a beta. We've set this goal to help stop us from getting too far ahead of ourselves with respect to what we want to see in the final release vs. what should be there at a minimum. |
Ok fine ! thx |
Hi, any news on this topic please ? |
@Cooker-Monster checking with my team, will let you know the update then. |
@jannyHou , you've mentioned that this is related to the openapi-v3 work that you're doing. Could you please add more details? Thanks. |
Seems to be a duplicate of #436. |
This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the |
Dear @bajtos , as I can see the "stale bot" gonna close this thread, because there is no activity. As I can see it is still a problem, not solved yet and may effect more developers. |
@lajosf I am afraid we don't have enough bandwidth to implement this feature soon. Would you like to contribute it yourself? |
Dear Bajtos, |
This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the |
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the |
Response code for POST method should be 201 not 200
An old issue from LoopBack3: strongloop/loopback#360
We should fix it in LoopBack4 as well.
Notes from the spike
Users should be able to customize the status code from the response object returned by the controller method, otherwise we should default to 201 - this will be implemented by Configurable response types/formats #436.
There are two approaches we can choose as implementation, but based on the spike findings and the consensus, pursue option 1 from below:
option 2: read the status code from OpenAPI spec and write it into the response in, see the spike PR [don't merge]poc: customize statusCode using response spec #1260rest/src/writer.ts
Acceptance criteria
example/*
projects so thatcreate*
methods (typically mapped toPOST
verb) return201 Created
instead of `200.Location
header to the URL where the newly created model instance can be foundThe text was updated successfully, but these errors were encountered: