encode / apistar

The Web API toolkit. 🛠
https://docs.apistar.com
BSD 3-Clause "New" or "Revised" License
5.57k stars 411 forks source link

No validation of requestBody schemas #661

Closed Lucidiot closed 5 years ago

Lucidiot commented 5 years ago

With the following schema:

paths:
  /something:
    post:
      operationId: postSomething
      requestBody:
        x-name: body
        content:
          application/json:
            schema:
              properties:
                name:
                  type: string
              required:
              - name

I can make the following request without any validation errors:

client.request('postSomething', body={'bad': 'ohno'})
carltongibson commented 5 years ago

I think this is the same issue as #660

Lucidiot commented 5 years ago

I'm not sure, yours was about the Media Type objects without a schema property, whereas here it is about the schema itself being used to validate the value. The value validation could totally happen without handling the schema property and vice versa.

tomchristie commented 5 years ago

We will check that you've got the correct set of arguments, but we don't validate outgoing requests - that's up to the API to do.