Skip to content

Commit

Permalink
Document schema_extra calling convention (#1645)
Browse files Browse the repository at this point in the history
  • Loading branch information
yurikhan committed Jun 27, 2020
1 parent ecb54c5 commit d5e1c88
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/usage/schema.md
Expand Up @@ -156,7 +156,10 @@ Outputs:
```

For more fine-grained control, you can alternatively set `schema_extra` to a callable and post-process the generated schema.
The callable is passed the schema dictionary as the first and only argument, and is expected to mutate it *in-place*; the return value is not used.
The callable can have one or two positional arguments.
The first will be the schema dictionary.
The second, if accepted, will be the model class.
The callable is expected to mutate the schema dictionary *in-place*; the return value is not used.

For example, the `title` key can be removed from the model's `properties`:

Expand Down

0 comments on commit d5e1c88

Please sign in to comment.