hugapi/hug

Put examples with the port

Open

#832 geöffnet am 15. Dez. 2019

Auf GitHub ansehen
 (2 Kommentare) (4 Reaktionen) (0 zugewiesene Personen)Python (389 Forks)batch import
enhancementhelp wanted

Repository-Metriken

Stars
 (6.758 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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"
                    ],```

Contributor Guide