Skip to content

Commit 81246cc

Browse files
committed
update get_examples to get_error_response_examples
1 parent 93d7ac9 commit 81246cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/openapi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ def get_serializer_for_validation_error_response(operation_id, field, error_code
391391
```
392392

393393
What remains is removing the default examples from the `AutoSchema` class or generating new ones that match the new
394-
error response output. Removing the default examples is easy and can be done by overriding `get_examples` and
395-
returning an empty list which leaves example generation up to the OpenAPI UI used (swagger UI, redoc, ...). But,
394+
error response output. Removing the default examples is easy and can be done by overriding `_get_error_response_examples`
395+
and returning an empty list which leaves example generation up to the OpenAPI UI used (swagger UI, redoc, ...). But,
396396
if you're picky about the examples and want to show that the `field_name` attribute is always `null` for errors
397397
other than validation errors, you can provide examples. Therefore, let's go with generating new examples for
398398
`403` and `404`.

0 commit comments

Comments
 (0)