open-api-spex / open_api_spex

Open API Specifications for Elixir Plug applications
Mozilla Public License 2.0
706 stars 183 forks source link

How to pass dynamic key-value pairs in the query #591

Open juise opened 8 months ago

juise commented 8 months ago

Hello!

By ex, I have the following struct:

  operation :index,
    summary: "ABC",
    parameters: [
      name: [in: :query, type: :string, required: false, example: "some_log_name"],
      meta: [in: :query, type: :boolean, required: false],
    ],
    responses: [
      ok: Schemas.paginated(Schemas.ABC),
    ]

And in case meta is true it is supposed that in the query could be some optional, dynamic key-value pairs. But in case I send a request without pre-defined queries, I get an error:

"detail": "Unexpected field: a"