Swagger: Reusing an enum definition as query parameter

前端 未结 2 608
粉色の甜心
粉色の甜心 2020-12-06 10:45

I would like to use an enum defined in definitions as part of my parameter definitions in a query string.

I\'m defining the Swagger Enum in the de

2条回答
  •  渐次进展
    2020-12-06 11:17

    For Swagger 2.0, we've limited the ability to use model definitions for anything but body parameters. The definitions section is used to define schema, which can also be used to define non-objects. However, those definitions can only be accessed where the schema keyword is used. As initially stated, schema not accessible for non-body parameters, and as such, cannot be used by query or path parameters, thus limiting the ability to reuse those definitions.

    There's an open feature request asking for it to be handled in a future version of the spec.

提交回复
热议问题