Skip to content

Commit 0f10ae2

Browse files
committed
doc: attribute exclusion in schema generation
1 parent f5128a3 commit 0f10ae2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

doc/tutorial.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,14 @@ This is useful for server implementations, so custom models or models provided b
357357
... ],
358358
... }
359359
360+
To disable an attribute in a custom resource subclass, annotate it with type ``None``:
361+
362+
.. code-block:: python
363+
364+
>>> class CustomUser(User):
365+
... # This attribute will be excluded from schema generation
366+
... external_id: None = None
367+
360368
Dynamic models from schemas
361369
===========================
362370

0 commit comments

Comments
 (0)