Open API V3 - ENUM keyword.

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
Speedlime
Posts: 39
Joined: Wed Feb 03, 2021 2:52 am

Open API V3 - ENUM keyword.

Post by Speedlime » Tue Aug 27, 2024 6:21 pm

Morning All

Does anyone know how we specify the ENUM values in the API Definition tab where we have defined the Components/Schema Types definitions for the ENUM values to print in the YAML when you tick Publish Open API V3, and then run the the documentation url.

From the guide:
OAS 3 This guide is for OpenAPI 3.0.
Enums
You can use the enum keyword to specify possible values of a request parameter or a model property. For example, the sort parameter in GET /items?sort=[asc|desc] can be described as:
paths:
/items:
get:
parameters:
- in: query
name: sort
description: Sort order
schema:
type: string
enum: [asc, desc]
In YAML, you can also specify one enum value per line:
enum:
- asc
- desc

Post Reply