Skip to content

How to set either one parameter be required? #126

@02040402

Description

@02040402

This way can set the special parameter required:

parameter do
  key :name, :id
  key :in, :path
  key :description, 'ID of pet to fetch'
  key :required, true
  key :type, :integer
  key :format, :int64
end

But if I want to let one of two parameters(either one is ok) be required as:

parameter do
  key :name, :id
  key :in, :path
  key :description, 'ID of pet to fetch'
  key :required, true
  key :type, :integer
  key :format, :int64
end

parameter do
  key :name, :user_id
  key :in, :path
  key :description, 'User ID of pet to fetch'
  key :required, true
  key :type, :integer
  key :format, :int64
end

Since each of them has key :required, true themselves. How to do in this case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions