drf-yasg

How to disable “Django Login” page when trying to access swagger api in browser?

纵然是瞬间 提交于 2021-02-20 02:52:22
问题 I am getting a blank page with just a "Django Login" link when trying to access generated swagger docs. I am using drf_yasg library to render swagger documentation. Code to generate swagger docs is similar to mentioned in swagger docs. schema_view = get_schema_view( openapi.Info( title="Snippets API", default_version='v1', description="Test description", terms_of_service="https://www.google.com/policies/terms/", contact=openapi.Contact(email="contact@snippets.local"), license=openapi.License

How to extend FastAPI docs with another swagger docs?

孤街醉人 提交于 2021-01-27 16:16:26
问题 I decided to make a micro-services gateway in Python's FastApi framework. My authorization service is written in Django and there are already generated by drf-yasg package swagger docs. I was thinking if there is a way to somehow import auth's schema to the gateway. I can serve the schema in json format via http and access it from the gateway. The question is how to integrate FastApi's docs with raw swagger schema file. 回答1: According to docs you can modify the openAPI json. Example: from

How to extend FastAPI docs with another swagger docs?

纵然是瞬间 提交于 2021-01-27 16:15:09
问题 I decided to make a micro-services gateway in Python's FastApi framework. My authorization service is written in Django and there are already generated by drf-yasg package swagger docs. I was thinking if there is a way to somehow import auth's schema to the gateway. I can serve the schema in json format via http and access it from the gateway. The question is how to integrate FastApi's docs with raw swagger schema file. 回答1: According to docs you can modify the openAPI json. Example: from

How to extend FastAPI docs with another swagger docs?

你离开我真会死。 提交于 2021-01-27 16:14:13
问题 I decided to make a micro-services gateway in Python's FastApi framework. My authorization service is written in Django and there are already generated by drf-yasg package swagger docs. I was thinking if there is a way to somehow import auth's schema to the gateway. I can serve the schema in json format via http and access it from the gateway. The question is how to integrate FastApi's docs with raw swagger schema file. 回答1: According to docs you can modify the openAPI json. Example: from

How to extend FastAPI docs with another swagger docs?

久未见 提交于 2021-01-27 16:13:05
问题 I decided to make a micro-services gateway in Python's FastApi framework. My authorization service is written in Django and there are already generated by drf-yasg package swagger docs. I was thinking if there is a way to somehow import auth's schema to the gateway. I can serve the schema in json format via http and access it from the gateway. The question is how to integrate FastApi's docs with raw swagger schema file. 回答1: According to docs you can modify the openAPI json. Example: from

How can I configure “HTTPS” schemes with the drf-yasg auto-generated swagger page?

南笙酒味 提交于 2021-01-26 11:01:11
问题 I know in a traditional swagger YAML file, we can define the schemes with: schemes: - http - https //OR schemes: [http, https] However, how can I do the same thing with auto-generated swagger page with the drf-yasg library? Now, the generated swagger page only contains HTTP schemes, but HTTPS is missing. I've tried set the DEFAULT_API_URL in setting.py to https://mybaseurl.com , but it seems not to be working. 回答1: There is a solution. When defining get_schema_view() in urls.py , use this

DRF post url without end slash

北战南征 提交于 2020-12-13 04:26:59
问题 In my application , I need to display the REST url(s) without a slash at the end. I have tried below combination but it didnt work. Added APPEND_SLASH=True in the settings.py and on the urls.py file from rest_framework.routers import SimpleRouter router = SimpleRouter(trailing_slash=False) After adding this when I am calling the urls without slash at the end in the postman, it is giving me an 404 error- URL not found. But with slash at the end is working fine. Is there any option to make this

DRF post url without end slash

北城以北 提交于 2020-12-13 04:26:05
问题 In my application , I need to display the REST url(s) without a slash at the end. I have tried below combination but it didnt work. Added APPEND_SLASH=True in the settings.py and on the urls.py file from rest_framework.routers import SimpleRouter router = SimpleRouter(trailing_slash=False) After adding this when I am calling the urls without slash at the end in the postman, it is giving me an 404 error- URL not found. But with slash at the end is working fine. Is there any option to make this

DRF YASG Customizing

主宰稳场 提交于 2020-06-25 04:50:05
问题 I'm trying to customize my api documentation buuild with yasg. First off, I would like to determine the naming of my own sections, and what endpoints should be included in this section. It seems that the naming of sections is based on the first prefix not belonging to the longest common prefix e.g.: if we have the urls api/v1/message and api/v1/test than the sections will be named message and test. Is there a way for me to determine A custom naming for this section? Furthermore, the