Skip to content

GET routes for Generic Actions do not assume the arguments as query params #349

@diogomrts

Description

@diogomrts

Describe the bug
When defining a GET route for a generic action, if we define optional arguments they are not accepted as query params.
In the open_api spec they are shown as part of the request body inside data but this also does not work unless we change the Route to POST.

To Reproduce

base_route "/operational-settings", Core.OperationalSetting do
  route(:get, "/:configuration_key", :get)
end

 action :get, :struct do
  constraints instance_of: Type.OperationalSettingValue

  argument :configuration_key, :string, allow_nil?: false
  argument :campaign_id, :string, allow_nil?: true

  run fn input, context ->
    get_setting(input.arguments, context.actor)
  end
end

Expected behavior
In the example above the mandatory path param configuration_key works as expected but the campaign_id is not accepted as query_param.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    Status

    Soon

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions