Skip to content

RegisteredLimit does not allow a defaultLimit of 0 #3866

Description

@gndrmnn

What happened?

The defaultLimit field for RegisteredLimits in Gophercloud is an integer with required:true

While OpenStack permits a value of 0, Gophercloud will fail validation for the field in that case.

Gophercloud runs into this:

gophercloud/params.go

Lines 92 to 97 in 7544537

if zero {
// if the field has a 'required' tag, it can't have a zero-value
err := ErrMissingInput{}
err.Argument = f.Name
return nil, err
}

Expected behavior would be that Gophercloud permits requests containing a defaultLimit of 0 (in fact everything from -1 to 2147483647 should be valid)

See also k-orc/openstack-resource-controller#782 (comment)

Version

v2 (current)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions