K
K
keddad2019-11-14 19:08:41
API
keddad, 2019-11-14 19:08:41

Why is this piece of OpenAPI not rendering correctly?

I describe the request. In it, I write requestBody:

requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Допустимые обновления
              properties:
                name:
                  type: string
                state:
                  enum:
                    - "freezed"
                    - "ongoing"
                    - "finished"

But it doesn't render correctly. It shows the state field in the Schema, but doesn't show the enums themselves.
3Hy24gP.png
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_, 2019-11-14
@keddad

Try adding type and default to state

state:
        type: string
        default: "freezed"
        enum:
          - "freezed"
          - "ongoing"
          - "finished"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question