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

Add descriptive response message when accessing base route "/" #80

Open
andrew-wang0 opened this issue Jan 13, 2025 · 6 comments
Open
Assignees
Labels
good first task Good for newcomers

Comments

@andrew-wang0
Copy link
Member

Expected Behavior

Since it is likely for users to hit the base route (eg when running dev), we could add a friendlier response for specifically the base route /

Current Behavior

Simple 404 response {"ok":false,"message":"The requested resource could not be found."} that is not informative

Possible Solution

This could instruct them to use /reference or /v2/rest/... or /v2/graphql

@andrew-wang0 andrew-wang0 added the good first task Good for newcomers label Jan 13, 2025
@laggycomputer
Copy link
Member

laggycomputer commented Jan 13, 2025

Do you think this would require an OpenAPI spec? I'd argue it should remain unspecified for SemVer reasons and just be a QoL hint.

@andrew-wang0
Copy link
Member Author

@laggycomputer No, I believe sanctioning the route in i/apps/api/src/index.ts should suffice

@rsahyoun
Copy link
Contributor

@andrew-wang0 May I take on this task if that is alright with you.

@andrew-wang0
Copy link
Member Author

@rsahyoun you got it!

@andrew-wang0
Copy link
Member Author

This might be better implemented as a check if the user agent is a browser, and redirecting to /reference, skipping the step of having to tell the user. Since, if the user was accessing the base route, they most likely wanted to go to the reference.

@rsahyoun
Copy link
Contributor

Ok good to know, I'll keep that in mind when I approach this issue.

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

No branches or pull requests

3 participants