jhthorsen / mojolicious-plugin-openapi

OpenAPI / Swagger plugin for Mojolicious
54 stars 42 forks source link

Handle default for requestBody properties #177

Closed mschout closed 4 years ago

mschout commented 4 years ago

In OAS3, requestBody properties can have a default like this:

requestBody:
  required: true
  content:
    application/json:
      schema:
        type: object
        properties:
          foo:
            type: string
            default: bar

Where if foo is not given in the request body, the value bar must be used instead.

Fixes #176

jhthorsen commented 4 years ago

It does not seem as this code handle defaults deep inside a document.

Either way, please see the comment on #176.