I want to define enum in openAPI
.
I looked at this post:
How to define an enum in OpenAPI (Swagger)?
and I want to be able to see the enum like:
I'm working with components
and I define it as:
components:
schemas:
FilterImg:
type: object
properties:
name:
type: string
enum: ["img_1", "img_2"]
value:
type: string
And I'm using it:
post:
summary: Add new img
tags:
- img
description: Lets a user post a new img
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/FilterImg'
responses:
'200':
description: Successfully
But I can't see the enum as enum scroll menu (in the web browser), as we can see it in the example.
What am I missing ?