-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
I have a model called File and noticed a weird error when trying to POST to it:
{ error:
{ name: 'Error',
status: 500,
message: 'Cannot create a file response from "object"',
stack: 'Error: Cannot create a file response from "object"\n at HttpContext.done ...
Renaming the model from File to afile or something like that fixes the issue. Here is a repo with a test case:
https://github.com/DaGaMs/loopback-file-bug-demo
It's really not ideal that loopback "clutters" the namespace for models like that. Both User and Change are reserved, and now it seems File is also a problem. It's a bit annoying to have to prefix my model names for that reason...
See #2554 (comment) for the proposed solution.
Tasks
- Fix the problem in strong-remotin@2.x - see Distinguish between "file" and "File" result types strong-remoting#370
- Start rejecting File/file custom types in strong-remoting@master - see Refuse to override builtin file type strong-remoting#379
- Update/create docs with a list of reserved type names - see lb3: describe reserved "File" type loopbackio/loopback.io#148
- Add a section to 3.0 Release Notes and Migration Guide - see lb3: describe reserved "File" type loopbackio/loopback.io#148
Reactions are currently unavailable