drf-spectacular
drf-spectacular copied to clipboard
Vendor extensions in schema fields
Hello,
I'm working on an API schema so that it plays nicely with the Prism mock server, and one of its features is the support for using Faker to generate field values.
However, this makes use of a vendor extension (x-faker
), and trying to set it (with a dict on extend_schema_field
) seems ineffective.
Is there any way to actually set this extra parameter?
Hi!
do you mean this? https://github.com/tfranzel/drf-spectacular/blob/66086cf2d18ca007224a79269efdfa74f1a035e1/tests/test_specification_extensions.py#L165
otherwise, please provide an example to make this easier to talk about.
Hi!
do you mean this?
https://github.com/tfranzel/drf-spectacular/blob/66086cf2d18ca007224a79269efdfa74f1a035e1/tests/test_specification_extensions.py#L165
otherwise, please provide an example to make this easier to talk about.
Hi, thanks for answering!
What I mean is extending the response properties - tried to set it on the serializer, but no dice. Like:
address:
type: string
maxLength: 64
x-faker: address.streetAddress