anomaly / anomaly/lab-python-server

Explore the option of sending partial entities as responses

Đang mở
#28 0 bình luận 0 reaction 1 người được giao Được @devraj nhận Xem trên GitHub
Ngôn ngữ chính
Python
Star
16
Fork
4
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

This is something I miss from my `prestans` days, we have a [feature](https://prestans.readthedocs.io/en/latest/validation.html#attribute-filters) we called `attribute_filters` it essentially allowed us toggle the visibility of fields in responses. What this allowed is to use the same model for different use cases e.g:

- List of users in the master view only needs, `id`, `name`, `email`
- Clicking a user then loads the entire user including children model (this is the heavy weight use case)

Pydantic has the idea of [excluding](https://pydantic-docs.helpmanual.io/usage/exporting_models/#advanced-include-and-exclude) keys when it serializes content.

Explore and document:
- if this is possible using the FastAPI + pydantic toolset
- is this an OK thing to do according the OpenAPI specification

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.