hugapi / hug

Embrace the APIs of the future. Hug aims to make developing APIs as simple as possible, but no simpler.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need support for python "typing" module in schema specification

DaveTrost opened this issue · 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"
    }
}```