Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Single item in array type query parameter is not converted to array

See original GitHub issue

Hi, I have the following query parameter

- in: query
  name: publication_time
  required: true
  style: form
  explode: true
      type: array
      minItems: 1
        type: string

When I pass muliple values like ?publication_time=someDay&publication_time=otherDay it’s fine but when I pass a single value ?publication_time=someDay, I get the error

{ errors:
   [ { path: '.query.publication_time',
       message: 'should be array',
       errorCode: 'type.openapi.validation' } ] }

Am I doing something wrong? Is there another way to pass an array with a single parameter using style=form and explode=true ?


Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

DylanBowdencommented, Jul 30, 2019

Wow, that’s fast 😃 Thanks

richdouglasevanscommented, Jul 30, 2019

Carmine doesn’t move at the speed of light. Light moves at the speed of Carmine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Class transformer not converting to array of numbers
These ids are coming via API query parameters. I am using Class Transformer to transform these ids into an array of numbers. But...
Read more >
how to set query params to array even if it has only one ...
but when i input ?assigned_domain=2 the param becomes a single string, how to make it an array even if it has only one...
Read more >
Arrays in query params - Medium
The value of the fields parameter MUST be a comma-separated (U+002C COMMA, “,”) list that refers to the name(s) of the fields to...
Read more >
Array functions for Bicep - Azure Resource Manager
Takes an array of arrays, and returns an array of subarray elements, in the original order. Subarrays are only flattened once, not recursively....
Read more >
PySpark Convert String to Array Column - Spark by {Examples}
... and converting it into ArrayType. In this article, I will explain converting String to Array column using split() function on DataFrame and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found