hugapi/hug

Put examples with the port

Open

#832 aberto em 15 de dez. de 2019

Ver no GitHub
 (2 comments) (4 reactions) (0 assignees)Python (389 forks)batch import
enhancementhelp wanted

Métricas do repositório

Stars
 (6.758 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

I have this method:

@hug.get('/documents/list')
def llista():
    """Returns whole list of documents"""
    docs = [lib.Doc(doc).HeaderstoJSON for doc in glob.iglob('./*.md')]
    return {'documents': docs}

and http://localhost:8000 returns me:

"documentation": {
        "handlers": {
            "/documents/list": {
                "GET": {
                    "usage": "Returns whole list of documents",
                    "examples": [
                        "http://localhost/documents/list"
                    ],
                    "outputs": {
                        "format": "JSON (Javascript Serialized Object Notation)",
                        "content_type": "application/json; charset=utf-8"
                    }
                }
            },

but really the autogenerated documentation should say the port:

                        "http://localhost:8000/documents/list"
                    ],```

Guia do colaborador