You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to one or multiple existing converters?
SpringConverter
Describe the solution you'd like
Spring allows query parameter definitions by simply passing an object.
On extracting query parameters every controller method should be check for parameters (objects, not interfaces) without any spring annotation. The limitation to the usual spring controller method annotations is important, because the parameter could have a JSR-303 annotation or the like.
Easiest way to to get on all properties without having to do the reflection manually might be to serialize the type as json and and then extract the paths from the json. Suggestion for seriallization lib could be klaxon or moshi
Unchecked:
How do primitives such as String, Int, Long etc behave?
Additional context Simple objects
data classParams1 (
vara:Stringvarb:String
)
data classParams2 (
vara:Stringvarc:String
)
@GetMapping("/todos")
fungetAllTodos(params1:Params1, params2 Params2) {
/* calling: /todos?a=val1&b=val2&c=val3 will result in : Params1(a = val1, b = val2) Params2(a = val1, c = val3)*/
}
Nested object
data classParams1 (
vara:Stringvarb:Params2
)
data classParams2 (
vara:Stringvarc:String
)
@GetMapping("/todos")
fungetAllTodos(params1:Params1) {
/* calling: /todos?a=val1&b.c=nestedvalue&c=othervalue will result in: Params1(a = val1, b = null) Params2(a = null, c = nestedvalue)*/
}
Extract query parameter names from json:
{
"a": null,
"b": {
"a": null,
"c": null
}
}
Must result in three query parameters:
a
b.a
b.c
The text was updated successfully, but these errors were encountered:
Hi @atlatosPonga,
thank you for your interest in the project. There are currently no concrete plans for the implementation or the timing of the implementation.
Pull requests are always welcome ;)
Is your feature request related to one or multiple existing converters?
SpringConverter
Describe the solution you'd like
Spring allows query parameter definitions by simply passing an object.
On extracting query parameters every controller method should be check for parameters (objects, not interfaces) without any spring annotation. The limitation to the usual spring controller method annotations is important, because the parameter could have a JSR-303 annotation or the like.
Easiest way to to get on all properties without having to do the reflection manually might be to serialize the type as json and and then extract the paths from the json. Suggestion for seriallization lib could be klaxon or moshi
Unchecked:
Additional context
Simple objects
Nested object
Extract query parameter names from json:
Must result in three query parameters:
a
b.a
b.c
The text was updated successfully, but these errors were encountered: