question-mark
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.

Add possibility to get an array from query parameter the usual way

See original GitHub issue

Hi,

Currently fast-endpoints needs array to be json formatted when received from query like so: /my-endpoint?Codes=[1,2,3]

This makes swagger not functional and consumers irritated. The default way is actually that arrays will be passed like this: /my-endpoint?Codes=1&Codes=2&Codes=3 but currently this will set the array to null

The dto:

public class MyEndpointRequest {
    public int[] Codes {get; set; }
}

Is it possible to implement this standard in fast-endpoints, too?

p.s.: thank you very much for this amazing project, I really appreciate it!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
maxrebcommented, Jul 25, 2022

Yes, works like a charm, thanks a lot 😃

0reactions
dj-nitehawkcommented, Jul 24, 2022

try v4.4.0-beta5 i think i finally nailed it 😃

the thing is we have to rely on STJ for the creation of different types of object collections that are to be assigned to the IEnumerable properties. otherwise we’d have to re-invent a massive wheel.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to pass an array within a query string?
Here's what I figured out: Submitting multi-value form fields, i.e. submitting arrays through GET/POST vars, can be done several different ...
Read more >
Arrays in query params
A client MAY request that an endpoint return only specific fields in the response on a per-type basis by including a fields[TYPE] parameter....
Read more >
Fun stuff: representing arrays and objects in query strings
Question: what's the correct way to represent arrays and objects in a URL query string? What do you think is the *correct* way...
Read more >
Using an array in where clause
Hello everyone, I need to run a query that is filtered by an array, but is not returning the desired result. I have...
Read more >
How to send a list/array of values as URL parameters
With a short list / array it is possible to include the values in the query string part of the URL. Its syntax...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found