Skip to content

Align the behavior of boolean query parameters in API #18891

@rubhanazeem

Description

@rubhanazeem

This API endpoint, /build/{project_name}/_result?lastsuccess=1, expects a lastsuccess query parameter, which can take any value.
Please have a look at the following code: https://github.com/openSUSE/open-build-service/blob/master/src/api/app/controllers/build_controller.rb#L150

The controller is only checking for the presence of the parameter, without validating the type or value it should contain. In this case, the API should restrict the lastsuccess parameter to either true/false or 0/1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIThings regarding our APIDocumentation 📖Things regarding our documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions