Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When an invalid endpoint URL or JSON object is provided, no error is shown #64

Open
jabelone opened this issue Feb 2, 2024 · 4 comments
Assignees

Comments

@jabelone
Copy link

jabelone commented Feb 2, 2024

Heya, after testing a potential fix related to this issue, I noticed that the validator showed no feedback in the UI when it failed to pass the data from that endpoint. This is confusing and makes me think that the validator is "broken" when really it just needs to throw up an error saying the endpoint couldn't be parsed because it's response doesn't follow the specification.

The endpoint in question will shortly be fixed, so I've included the problematic JSON response that triggers this behaviour below for testing purposes. Changing the api_compatibility version from "0.14" to "14" causes it to parse correctly and show a different, unrelated error in the validator UI.

{
    "space": "Brisbane Makerspace",
    "logo": "https://brisbanemaker.space/wp-content/uploads/2021/10/BMS-Logo-ONLY.png",
    "url": "https://brisbanemaker.space/",
    "contact": {
        "email": "[[email protected]](mailto:[email protected])",
        "twitter": "",
        "phone": "",
        "facebook": ""
    },
    "spacefed": {
        "spacenet": false,
        "spacesaml": false,
        "spacephone": false
    },
    "projects": [],
    "issue_report_channels": [
        "email"
    ],
    "state": {
        "open": false,
        "message": "Welcome to BMS!",
        "lastchange": 1699966832.295935
    },
    "icon": {
        "open": "https://brisbanemaker.space/wp-content/uploads/2021/10/favicon.png",
        "closed": "https://brisbanemaker.space/wp-content/uploads/2021/10/favicon.png"
    },
    "api_compatibility": [
        "0.14"
    ],
    "sensors": {
        "total_member_count": {
            "value": 62
        },
        "people_now_present": {
            "value": 0
        }
    },
    "location": {
        "address": "146 Wickham St, Fortitude Valley, QLD 4006 Australia",
        "lat": -27.458819,
        "lon": 153.032185
    }
}
@dbrgn
Copy link
Contributor

dbrgn commented Feb 3, 2024

The problem is in the v2 API endpoint itself. I'll investigate.

@dbrgn
Copy link
Contributor

dbrgn commented Feb 3, 2024

Validation is delegated to https://github.com/spaceapi-community/go-spaceapi-validator, which simply returns the error EOF. The problem should get fixed in spaceapi-community/go-spaceapi-validator#2

Additionally, the UI should properly handle API responses. Right now, nothing happens. However, I can't seem to find the source code of the validator UI, it's not part of this repository 😂 @gidsi could you help out?

@dbrgn
Copy link
Contributor

dbrgn commented Apr 11, 2024

Validator web UI is here: https://github.com/spaceapi-community/validator-web

@psy0rz
Copy link

psy0rz commented Sep 11, 2024

ah i see, thanks!:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants