I am new to OpenApi and want to define my api with an api.yaml (OpenApi version 3.0.1). My problem is the generated enum just contains the name and not the values.
This is the enum in my code:
TEST1(1, "Test 1", "T1"),
TEST2(2, "Test 2", "T2"),
TEST3(3, "Test 3", "T2");
And this is the enum after generating it with OpenApi:
TEST1("TEST1"),
TEST2("TEST2"),
TEST3("TEST3");
The enum is automatically defined like this:
testenum:
type: string
description: desciption of the enum
enum:
- TEST1
- TEST2
- TEST3
How can I define the enum in my api.yaml to look like the first example?
type: string
you will only get one string to use – Noisemaker