-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples in request and response #115
Labels
enhancement
New feature or request
Comments
that is currently not supported. would be a nice feature addition though. it would probably be another parameter to |
how about these code to support example feature? @extend_schema_serializer(
examples=[
OpenApiExample( 'ex1',
summary='i_am_summary',
description='long description...'
value={
'username':'i_am_user1',
'password':'1234'
}
),
OpenApiExample('ex2',
....
),
],
exclude_fields = ("date_joined",)
)
class UserSerializer(serializer.ModelSerializer):
class Meta:
model = User
fields = ("username","passwod", "date_joined") and this is in my thought to support Swagger Components <-> DRF Components @extend_schema_parameter(
# something to customize.
)
class UserFilterSet(filters.FilterSet):
class Meta:
model = User
fields =. ("username","email") |
KimSoungRyoul
added a commit
to Ice-Caramel-Macchiato/drf-spectacular
that referenced
this issue
Nov 29, 2020
KimSoungRyoul
added a commit
to Ice-Caramel-Macchiato/drf-spectacular
that referenced
this issue
Nov 29, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it possible to pass example in request or response in APIView to create example request with swagger and see examle response?
The text was updated successfully, but these errors were encountered: