hug icon indicating copy to clipboard operation
hug copied to clipboard

Need support for python "typing" module in schema specification

Open DaveTrost opened this issue 5 years ago • 0 comments

Hug code to replicate:

import hug
from typing import List


@hug.post('/hosts')
def post_hosts(ips: List[str]):
    return {'ips': ips}

POST body:

{
	"ips": ["10.201.7.250", "10.201.7.251"]
}

Error response:

{
    "errors": {
        "ips": "Type List cannot be instantiated; use list() instead"
    }
}```

DaveTrost avatar Feb 11 '20 00:02 DaveTrost