loopbackio / loopbackio/loopback-next
Make getFilterJsonSchemaFor() model-aware
@agnes512 đang làm issue này rồi.
Từ ngày 2/4/2020.
- Ngôn ngữ chính
- TypeScript
- Star
- 5.1k
- Fork
- 1.1k
- Merge trung bình
- 2 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 27
Mô tả
Currently, getFilterJsonSchemaFor() isn't model-aware.
This means that the openapi.json order filter parameter will be generic:

In the case above, it's the /todos parameter from the Todo example.
This would lead to issues where the suggested order filter isn't a valid query:

(Notice the "order": [ "string" ])
Steps to reproduce
A quick way to reproduce is use the Todo example:
lb4 example todo
This also applies to any LoopBack 4 application that utilises @param.filter(ModelHere).
Expected Behavior
The order filter should be model-aware and not generic.
Link to reproduction sandbox
lb4 example todo
Additional information
$ node -e 'console.log(process.platform, process.arch, process.versions.node)' && \
> npm ls --prod --depth 0 | grep loopback
win32 x64 12.16.1
@loopback/example-todo@3.0.2 C:\Users\rifaa\Documents\loopback4-example-todo
+-- @loopback/boot@2.0.2
+-- @loopback/context@3.2.0
+-- UNMET PEER DEPENDENCY @loopback/core@2.2.0
+-- @loopback/openapi-v3@3.1.1
+-- UNMET PEER DEPENDENCY @loopback/repository@2.0.2
+-- @loopback/rest@3.1.0
+-- @loopback/rest-explorer@2.0.2
+-- @loopback/service-proxy@2.0.2
npm+-- loopback-connector-rest@3.6.0
ERR! peer dep missing: @loopback/core@^1.12.0, required by @loopback/model-api-builder@2.0.2
npm ERR! peer dep missing: @loopback/repository@^1.16.0, required by @loopback/model-api-builder@2.0.2
npm ERR! peer dep missing: @loopback/core@^1.12.0, required by @loopback/model-api-builder@2.0.2
npm ERR! peer dep missing: @loopback/repository@^1.16.0, required by @loopback/model-api-builder@2.0.2
npm ERR! peer dep missing: @loopback/core@^1.12.0, required by @loopback/model-api-builder@2.0.2
npm ERR! peer dep missing: @loopback/repository@^1.16.0, required by @loopback/model-api-builder@2.0.2
npm ERR! peer dep missing: @loopback/core@^1.12.0, required by @loopback/model-api-builder@2.0.2
npm ERR! peer dep missing: @loopback/core@^1.12.0, required by @loopback/model-api-builder@2.0.2
npm ERR! peer dep missing: @loopback/core@^1.12.0, required by @loopback/model-api-builder@2.0.2
Related Issues
N/A
See Reporting Issues for more tips on writing good issues
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Đánh giá
Issue này chưa được đánh giá.