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

Make required fields required, simplify binding and improve error messages #1073

Open
morremeyer opened this issue Sep 1, 2024 · 1 comment
Labels
development Things that support development of the software

Comments

@morremeyer
Copy link
Member

morremeyer commented Sep 1, 2024

For fields that need to be set in the API, e.g. the Month field in URIMonth and QueryMonth, thebinding:"required" tag should be set.

Errors on binding should be handled with e.g. a middleware, see gin-gonic/gin#430 (comment) for inspiration.

With this, the parseMonthQuery could probably be removed, too.

There should be only one struct for API responses with the fields data, error and links ideally, so that all responses can be handled in the same way.

@morremeyer morremeyer added the development Things that support development of the software label Sep 1, 2024
@morremeyer
Copy link
Member Author

Current state pushed to chore/error-handling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Things that support development of the software
Projects
None yet
Development

No branches or pull requests

1 participant