Skip to content

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

@morremeyer

Description

@morremeyer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    developmentThings that support development of the software

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions