anomaly / anomaly/lab-python-server

Explore the option of sending partial entities as responses

オープン
#28 コメント 0 件 リアクション 0 件 担当者 1 名 @devraj が担当を希望しています GitHub で見る
主要言語
Python
スター
16
フォーク
4
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。