cancel
Showing results for 
Search instead for 
Did you mean: 

how do you specify a custom serializer for your models in Swagger UI 2.x?

SOLVED
nobody1
New Member

how do you specify a custom serializer for your models in Swagger UI 2.x?

Hi, I'm upgrading from Swagger 0.3.x to 2.x:

 

In 0.3.x, you could specify a custom model serializer via a docstring YAML comment, e.g.

https://django-rest-swagger.readthedocs.io/en/stable-0.3.x/yaml.html

 

def retrieve(self, request, *args, **kwargs):
"""
Get domain details.

Example Response:\n
{
"id": "blah"
}
---
# YAML (for swagger documentation after the ---)
serializer: ..serializers.MySerializer

 

I'm not seeing how to do this in Swagger [UI] 2.x.

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
RonRatovsky
Moderator

Re: how do you specify a custom serializer for your models in Swagger UI 2.x?

swagger-rest-swagger is not one of our projects, so we're unable to provide support for it. You best bet is to file a ticket with the project.


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓

View solution in original post

1 REPLY 1
RonRatovsky
Moderator

Re: how do you specify a custom serializer for your models in Swagger UI 2.x?

swagger-rest-swagger is not one of our projects, so we're unable to provide support for it. You best bet is to file a ticket with the project.


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements