pypi fastapi 0.1.16
Query and Header can be lists, 100% coverage

latest releases: 0.110.2, 0.110.1, 0.110.0...
5 years ago

Query and Header parameters can be lists:

from typing import List

from fastapi import FastAPI, Query

app = FastAPI()

@app.get("/items/")
def read_items(q: List[int] = Query(None)):
    return {"q": q}

With a URL of /items/?q=5&q=6, q will contain [5, 6].

To define query or header parameters as lists it is necessary to explicitly use Query or Header, otherwise, FastAPI will assume they are request bodies.

100% coverage

FastAPI is fully tested.

The tests cover 100% of the source code.

Coverage

Automatic Security checks and utils

Security utils, like HTTPBasic have checks that directly return HTTP errors to the client when the scheme is invalid or doesn't contain data.

There are new models to contain the value of HTTP security utils, as HTTPBasicCredentials, that contains the decoded username and password.

Bug fixes for Python 3.7

Several fixes for Python 3.7. For issues that didn't show in Python 3.6.

Docs

Several new tutorials and docs.

Improvements to existing docs.

Don't miss a new fastapi release

NewReleases is sending notifications on new releases.