Validation of an object with a list as one if its members fails


#1

Here is a minimal example

from apistar import App, Route, types, test

class Foo(types.Type):
    arr = types.validators.Array(items=types.validators.String())

def post_foo(foo: Foo):
    return

routes = [Route('/', method='POST', handler=post_foo),]
app = App(routes=routes)

if __name__ == '__main__':
    client = test.TestClient(app)
    response = client.post('/', data={'arr': ['foo', 'bar', 'baz'],})
    assert response.status_code == 200, f"got {response}"

Running this with v5.15 the assersion fails and indicates that we got back a <Response [400]>
am I doing something wrong, or is this a bug?


#2

It seems that issue#507: JSON list in request body automatic validation addresses this issue.