Versions:
coreapi==2.3.1
Django==1.11.2
django-rest-framework==0.1.0
django-rest-swagger==2.1.2
django-silk==1.0.0
djangorestframework==3.6.3接口端点:/search?filter=("pages")?filter=("people")
在我的SwaggerSchemaView中,我定义了filter字段,如下所示:
coreapi.Field(name="filters", description="=search(query)", location="query", type="array", required=True)Swagger看起来像这样:

现在,当我在value框中提供值时,会产生以下格式的api:
/search?filter=("pages"),("people")我怎样才能让swagger遵守我想要的格式
/search?filter=("pages")?filter=("people")
发布于 2017-09-22 16:55:37
CoreAPI开箱即用不支持您所需要的东西。它将在此问题得到解决后- https://github.com/core-api/python-openapi-codec/issues/25
但它在使用style和explode params - https://swagger.io/specification/的OpenAPI(Swagger)中可用
我建议您编写自己的swagger yaml,而不是从DRF生成它,因为DRF与Swagger不一致,无法从中提取所有需要的信息。
https://stackoverflow.com/questions/45332442
复制相似问题