`Include` seems to ignore its `url` argument in `/schema`


#1

Consider this app.py (using ApiStar 0.5.10)

#!/usr/bin/env python
from apistar import App, Include, Route

def foo():
    return 'FOO'

def bar():
    return 'BAR'

foo_routes = [Route('/', 'GET', foo)]
bar_routes = [Route('/', 'GET', bar)]
reoutes = [
    Include('/foo', name='foo', routes=foo_routes),
    Include('/bar', name='bar', routes=bar_routes),
]
app = App(routes=reoutes)

if __name__ == '__main__':
    app.serve('127.0.0.1', 5555, use_debugger=True)

It serve both GET /foo and GET /bar correctly, however wget http://127.0.0.1:5555/schema/ -qO - gives only:

{
    "openapi": "3.0.0",
    "info": {
        "title": "",
        "description": "",
        "version": ""
    },
    "paths": {
        "/": {
            "get": {
                "tags": [
                    "bar"
                ],
                "operationId": "bar"
            }
        }
    }
}

That is, it shows the /bar path as / which shadows /foo (which is also on the /).

Am I doing something wrong, or is this a bug.


#2

Update: Opend an issue#516.


#3

Yup, thanks! This is now being addressed in https://github.com/encode/apistar/pull/493