OPEN API 3.0将in查询参数扩展到路径部分

时间:2019-04-12 18:13:29

标签: api openapi json-api

可以在OPEN API工作表的“组件”部分的“参数”部分中定义参数。 同时,可以在“响应”部分下将该参数引用到路径中。

我想做的是,例如具有路径类型的参数“ include”的数组将仅覆盖架构部分的部分枚举,而路径部分则引用组件一个中的那个。

似乎在该上下文中不允许使用allOf指令,有没有办法做到这一点? 也许我只需要一个例子。

示例:

在components.parameters部分:

- name: include
  in: query
  description: relationships to include
  type: array
  style: form
  explode: true
  schema: 
     type: array
     items:
        type: string

在路径中。 ..参数部分:

- name: include
  in: query
  description: relationships to include
  type: array
  style: form
  explode: true
  schema: 
     type: array
     items:
        type: string
        enum: [legs, owner]           

我只想重新定义枚举部分而不是

0 个答案:

没有答案
相关问题