在使用 OpenApi 规范的 swagger 文档中,您可以使用 application/json 将参数中的模式包装到内容中:
parameters:
- in: query
name: filter
# Wrap 'schema' into 'content.<media-type>'
content:
application/json: # <---- media type indicates how to serialize / deserialize the parameter content
schema:
type: object
properties:
type:
type: string
color:
type: string
发送这样的对象filter={"type":"t-shirt","color":"blue"}
。如何在 swagger-php 中做到这一点?