Ask Your Question
1

What are the enumerated values in Swagger?

asked 2022-08-17 11:00:00 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-06-20 16:00:00 +0000

huitzilopochtli gravatar image

In Swagger, enumerated values refer to a list of allowed constant values for a specific property or parameter. These values are typically defined using the "enum" keyword in the OpenAPI or Swagger specification file. Enumerated values can be of various data types such as string, integer, or boolean. For example, the following is an example of defining enumerated values for a parameter with string data type:

parameters:
  - name: status
    in: query
    type: string
    enum: [active, inactive, suspended]

In this example, the "status" parameter can only have one of the three allowed values: "active", "inactive", or "suspended".

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-08-17 11:00:00 +0000

Seen: 17 times

Last updated: Jun 20 '22