简体   繁体   English

django DJA,带有浮动设置内容类型

[英]django DJA with swagger setting content-type

I want to use the JSON API format for our API and django-rest-framework-json-api seems to work perfectly for that. 我想为我们的API使用JSON API格式,而django-rest-framework-json-api似乎可以完美地工作。

However, I also use swagger. 但是,我也用招摇。 Now DJA follows content-negotiation-clients 现在,DJA遵循内容协商客户端

Loading the swagger docs goes fine however when I want to try something it does not follows the JSON API content negotiation. 加载swagger文档很好,但是当我想尝试某些操作时,它不会遵循JSON API内容协商。 When I change the curl command and run it in the shell it goes fine. 当我更改curl命令并在shell中运行它时,它运行正常。

How can I change Django swagger to add the Content-Type: 'application/vdn.api+json' ? 如何更改Django swagger以添加Content-Type:'application / vdn.api + json'?

( it is basically this first problem django-rest-framework-json-api/issues , however, she does not state how she solved that issue only the second issue) (基本上,这是第一个问题django-rest-framework-json-api / issues ,但是,她仅说明第二个问题就没有说明如何解决该问题)

在我看来,答案似乎已经在这里列出了…… https://github.com/django-json-api/django-rest-framework-json-api/issues/314

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM