Error in GBFS feed

88 views
Skip to first unread message

Ortwin Gentz, FutureTap

unread,
Apr 21, 2022, 1:09:35 PM4/21/22
to openov
Hello,
I'd love to integrate the ov-fiets GBFS feed in our Where To? app. However, I noticed that the station_status.json feed is wrong. The stations array contains dictionaries of `stations` arrays with one member each. Instead, the stations array should contain dictionaries directly. Also, there's a superfluous comma after the "last_reported" field, so it fails JSON validation.

    "stations": [{
        "stations": [{
            "station_id": "gn001",
            "num_bikes_available": 589,
            "num_docks_available": 1,
            "is_installed": 1,
            "is_renting": 1,
            "is_returning": 1,
            "last_reported": 1650560521,
        }]
    }, …]

should be:

    "stations": [{
            "station_id": "gn001",
            "num_bikes_available": 589,
            "num_docks_available": 1,
            "is_installed": 1,
            "is_renting": 1,
            "is_returning": 1,
            "last_reported": 1650560521
    }, …]

Could this be fixed?

Best Regards,
Ortwin

Stefan de Konink

unread,
Apr 21, 2022, 2:40:21 PM4/21/22
to ope...@googlegroups.com
Hi Ortwin,

On Thursday, April 21, 2022 7:09:35 PM CEST, Ortwin Gentz, FutureTap wrote:
> I'd love to integrate the ov-fiets GBFS feed in our Where To?
> app. However, I noticed that the station_status.json feed is
> wrong. The stations array contains dictionaries of `stations`
> arrays with one member each. Instead, the stations array should
> contain dictionaries directly.

Thanks for your report, fixed that for you.

> Also, there's a superfluous comma
> after the "last_reported" field, so it fails JSON validation.

Interesting report, because this has been fully generated with a JSON
serialiser on top of Python, and above all... validates. I think this is a
bug at your side.

--
Stefan

Ortwin Gentz, FutureTap

unread,
Apr 22, 2022, 3:53:03 AM4/22/22
to openov
Hi Stefan,
thanks for the super-quick fix. Our feed parser accepts the additional comma just fine. I just stumbled upon it because jsonlint.com complained about it.

Thanks
Ortwin

Stefan de Konink

unread,
Apr 22, 2022, 3:57:46 AM4/22/22
to ope...@googlegroups.com
On Friday, April 22, 2022 9:53:03 AM CEST, Ortwin Gentz, FutureTap wrote:
> Hi Stefan,
> thanks for the super-quick fix. Our feed parser accepts the additional
> comma just fine. I just stumbled upon it because jsonlint.com complained
> about it.

I am really curious if you can download a file where this happens and show
it in a plain text editor.

--
Stefan

Ortwin Gentz, FutureTap

unread,
Apr 22, 2022, 3:59:35 AM4/22/22
to openov
One more question: I noticed, `num_docks_available` is always 1. I assume you simply set this to a constant number because free docks aren't tracked, right?

Stefan de Konink

unread,
Apr 22, 2022, 4:05:31 AM4/22/22
to ope...@googlegroups.com
On Friday, April 22, 2022 9:59:35 AM CEST, Ortwin Gentz, FutureTap wrote:
> One more question: I noticed, `num_docks_available` is always 1. I assume
> you simply set this to a constant number because free docks aren't tracked,
> right?

There are always unlimited available free spaces, because the system does
not work with docks. is_installed and is_renting are also static.

--
Stefan

Ortwin Gentz, FutureTap

unread,
Apr 22, 2022, 4:40:13 AM4/22/22
to openov
There are always unlimited available free spaces, because the system does
not work with docks. is_installed and is_renting are also static.

Makes sense, thanks.

Regarding the linter error, I tracked it down to a broken Safari extension (SimplyJSON) that added the comma in its prettified view. When I copy the raw JSON everything is fine. So definitely a bug on my side!

Ortwin
 

Ortwin Gentz, FutureTap

unread,
May 16, 2022, 2:35:54 PM5/16/22
to openov
Right now, the GBFS feed returns an empty body. Is this a known issue?

Stefan de Konink

unread,
May 16, 2022, 2:42:47 PM5/16/22
to ope...@googlegroups.com
On Monday, May 16, 2022 8:35:54 PM CEST, Ortwin Gentz, FutureTap wrote:
> Right now, the GBFS feed returns an empty body. Is this a known issue?

Nope. But a restart seem to have solved the emptyness.

--
Stefan

Ortwin Gentz, FutureTap

unread,
Jul 27, 2022, 10:43:43 AM7/27/22
to openov
Looks like the problem has returned. At least the root feed is empty.

Stefan de Konink

unread,
Jul 27, 2022, 10:45:50 AM7/27/22
to ope...@googlegroups.com
I restarted it again.
--
Stefan

Ortwin Gentz, FutureTap

unread,
Jul 27, 2022, 10:47:17 AM7/27/22
to openov
Thanks!

Ortwin Gentz, FutureTap

unread,
Jul 29, 2022, 10:14:46 AM7/29/22
to openov
empty again… :(
Reply all
Reply to author
Forward
0 new messages