Skip to content

exactly_one_of seems not work for nested parameters #1288

@mmkhmk

Description

@mmkhmk

Hello,

I'm currently creating an API with the latest version(0.14.0) but exactly_one_of doesn't work as expected for nested parameters.

Here is the sample.

params do
  optional :additionalFacets, type: Hash do
    requires: label, type: String
    requires: facet, type: Hash do
      requires :field, type: String
      requires :type, type: String

      optional :limit, type: Integer
      optional :start, type: Integer

      exactly_one_of :limit, :start
    end
  end
end

In this case I meant the validation of exactly_one_of works only when additionalFacets are given.
But it works when it is not given as well.

Can you help check this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions