readmeio/oas

Enum in inline parameters

jfedyczak opened this issue · 1 comments

Is it possible to specify enum with type string in inline parameter?

Yep! It should work as you normally would in an OAS/Swagger file.

/*
 * @api [get] /pets
 * description: "Returns all pets from the system that the user has access to"
 * responses:
 *   "200":
 *     description: "A list of pets."
 *     schema:
 *       type: "string"
 *       enum:
 *         - available
 *         - pending
 *         - sold
 */

https://swagger.io/docs/specification/describing-parameters/#enum