-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to implement a repeated request parameter #9
Comments
Hi, Thank you for this issue, i know this would happen eventually. I am quite busy on another project at the moment, feel free to make a pull request, but once finished i can work on it. |
Laying traps for unsuspecting developers so you can get PR's of them. Genius! I'm not exactly bristling with free time myself, but let me look at it. |
Haha. |
Good and bad news... |
After all implementing it from scratch seems a lot faster now. |
Do you intend to let us specify how parameters have to be encoded? Or will you just accept anything the client throws at you? |
You will have to specify, defaults being according to the openapi spec, but i will try to make it parse anything you throw at it. |
I Have finished implementing the primitives: |
Wow, you're on fire! I'll build your branch and see how that works for my usecase. It's really simple, I just need a list of longs, so that shouldn't be a problem. I'll let you know asap. |
I am working on the lists and arrays, it's a little trickier than primitives. |
Just a brainfart. Shouldn't RFC 6570 be implemented as a format for kotlinx-serialization? |
nope, ktor doesn't support RFC 6570 parsing, and no library is made to properly parse individual parameters... |
lists have been added, you can build the latest changes on jitpack |
objects are next, but i think i will limit the support to data classes in the beginning... |
Deep object support has been added. It does not support empty indices for arrays. |
Hi, I've been trying to use your branch but it's not yet working for me. |
If the main library works the test branch should work as well... dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "ch.qos.logback:logback-classic:$logback_version"
implementation "io.ktor:ktor-server-core:$ktor_version"
implementation "io.ktor:ktor-server-host-common:$ktor_version"
implementation "io.ktor:ktor-metrics:$ktor_version"
implementation "io.ktor:ktor-server-sessions:$ktor_version"
implementation "io.ktor:ktor-server-netty:$ktor_version"
implementation "io.ktor:ktor-jackson:$ktor_version"
implementation 'com.github.papsign:Ktor-OpenAPI-Generator:experimental-parameters-SNAPSHOT'
} |
@sheepdreamofandroids It's over, it's done... |
I have merged the changes into master and made a release. |
I'm trying to use this in my own project and it just doesn't work. |
Alright. |
Hi, I had weird effects. First everything worked as expected except for the array parameter and the fact that I couldn't debug my project in Intellij, it would freeze completely. |
No reason the ktor version is not updated. |
Thanks so much for the help. Now it works. |
I must be missing something completely. My usecase is a simple GET endpoint taking a list of Long ids and returning associated data.
I modelled the input parameter "ids" as
When calling it with parameters like
?ids=1&ids=2&ids=3
I get this error:Why would a request parameter be deserialized from xml or json?
I love this library BTW, it's a very elegant solution!
The text was updated successfully, but these errors were encountered: