readrops / Readrops

Android multi-services RSS client
GNU General Public License v3.0
251 stars 19 forks source link

Expecting END_OBJECT issue #162

Open mbnoimi opened 1 year ago

mbnoimi commented 1 year ago

First of all I'd like to thank you a lot for the greate project.

Whenever I try to connect Readrops with my FreshRSS service I get this error message:

Expected END_OBJECT but was NAME at path $.item[0].alternate[0].href

Is there anything wrong with my service configuration or what?

image

InterferencePattern commented 1 year ago

I'm getting the same error, but for context I also just changed my Fresh RSS container in a few ways

Alkarex commented 1 year ago

It looks like a bug in:

https://github.com/readrops/Readrops/blob/8a5fae5411420a135162143d7e279157dc17555c/api/src/main/java/com/readrops/api/services/freshrss/adapters/FreshRSSItemsAdapter.kt#L85-L102

the response might contain:

    "alternate": [
        [
            "href": "https://example.net",
            "type": "text/html"
        ]
    ]

The line "type": "text/html" was not always provided before.

In any case, additional key-values should not break the parsing.

Alkarex commented 1 year ago

Patch suggestion (not tested - no compile environment set up) https://github.com/readrops/Readrops/pull/163

Alkarex commented 1 year ago

Workaround https://github.com/FreshRSS/FreshRSS/pull/4568 while waiting for above Readrops fix to be tested and merged.