entur / lamassu

Mobility hub
European Union Public License 1.2
5 stars 7 forks source link

Possibility to retrieve systems grouped by operator #483

Open hbruch opened 3 months ago

hbruch commented 3 months ago

Is your feature request related to a problem? Please describe. Currently, neither gbfs/ endpoint (for GBFSv2) nor the manifest.json endpoint for GBFSv3 provide information, which systems are operated by which operator.

Goal / high level use-case Mobility Apps usually group different systems by provider, e.g. to limit the number of options in preferences (see this discussion in the MobilityData GBFS slack).

Describe the solution you'd like I suggest a new endpoint gbfs/operators.json which lists the operators (their id and name) and their published systems.

Describe alternatives you've considered Alternatively,

Additional context Example of a possible endpoint response:

{
    "operators": [
        {
            "id": "DER:Operator:deer",
            "name": {
                "translation": [
                    {
                        "language": "de",
                        "value": "Deer"
                    }
                ]
            },
            "systems": [
                {
                    "id": "deer",
                    "url": "http://localhost:8080/gbfs/deer/gbfs"
                }
            ]
        },
        {
            "id": "DKY:Operator:donkey",
            "name": {
                "translation": [
                    {
                        "language": "de",
                        "value": "Donkey Republic"
                    }
                ]
            },
            "systems": [
                {
                    "id": "donkey_ge",
                    "url": "http://localhost:8080/gbfs/donkey_ge/gbfs"
                }
            ]
        },
        {
            "id": "NBK:Operator:nextbike",
            "name": {
                "translation": [
                    {
                        "language": "de",
                        "value": "Nextbike"
                    }
                ]
            },
            "systems": [
                {
                    "id": "nextbike_df",
                    "url": "http://localhost:8080/gbfs/nextbike_df/gbfs"
                },
                {
                    "id": "nextbike_fg",
                    "url": "http://localhost:8080/gbfs/nextbike_fg/gbfs"
                },
                {
                    "id": "nextbike_ds",
                    "url": "http://localhost:8080/gbfs/nextbike_ds/gbfs"
                },
                {
                    "id": "nextbike_vn",
                    "url": "http://localhost:8080/gbfs/nextbike_vn/gbfs"
                }
            ]
        },
        {
            "id": "MEC:Operator:my-e-car",
            "name": {
                "translation": [
                    {
                        "language": "de",
                        "value": "My-E-Car"
                    }
                ]
            },
            "systems": [
                {
                    "id": "my-e-car",
                    "url": "http://localhost:8080/gbfs/my-e-car/gbfs"
                }
            ]
        }
    ]
}
testower commented 3 months ago

Complementary to #355