-
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(204, ... ) will not create the same type of response as schema definition. #4841
Comments
Hey @mschnee, Could you please take a look? |
It seems that the Link to reproduction sandboxhttps://github.com/achrinzatest/loopback4-sandbox-4841 Additional information$ node -e 'console.log(process.platform, process.arch, process.versions.node)' && npm ls --prod --depth 0 | grep loopback
win32 x64 12.16.0
[email protected] C:\Users\rifaa\Documents\loopback4-sandbox-4841
+-- @loopback/[email protected]
+-- @loopback/[email protected]
+-- UNMET PEER DEPENDENCY @loopback/[email protected]
npm+-- @loopback/[email protected]
ERR!+-- UNMET PEER DEPENDENCY @loopback/[email protected]
peer dep missing: @loopback/core@^1.12.0, required by @loopback/[email protected]
+-- @loopback/[email protected]
npm+-- @loopback/[email protected]
ERR!+-- @loopback/[email protected]
peer dep missing: @loopback/repository@^1.16.0, required by @loopback/[email protected]
npm ERR! peer dep missing: @loopback/core@^1.12.0, required by @loopback/[email protected]
npm ERR! peer dep missing: @loopback/repository@^1.16.0, required by @loopback/[email protected]
npm ERR! peer dep missing: @loopback/core@^1.12.0, required by @loopback/[email protected]
npm ERR! peer dep missing: @loopback/repository@^1.16.0, required by @loopback/[email protected]
npm ERR! peer dep missing: @loopback/core@^1.12.0, required by @loopback/[email protected]
npm ERR! peer dep missing: @loopback/core@^1.12.0, required by @loopback/[email protected]
npm ERR! peer dep missing: @loopback/core@^1.12.0, required by @loopback/[email protected] |
I see you have indeed reproduced it in your sandbox. Let me know if there's anything more I can do to help out! |
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 |
Steps to reproduce
Current Behavior
If I want to use decorators for response, I cannot seem to get a correct 204 in the explorer.
If I use the schema definition:
I get a clean 204 in the explorer:
If I use the decorator however:
I get the typeselector for the response:
Since I cannot stack the
@response
decorators once I use the schema as described above, I can't easily compose my responses if the default return type is 204.Finally, if I define no schema and no response decorator, the default return code is 200 which should be success with data instead of 204, which would make more sense if no data return type has been specified.
Expected Behavior
Link to reproduction sandbox
This works with the simple lb4 app empty project and a controller with that endpoint. Look at the explorer to see the difference.
Additional information
None required.
Related Issues
I searched for 204 but I could not find anything similar.
The text was updated successfully, but these errors were encountered: