[
https://issues.apache.org/jira/browse/CXF-8624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17879974#comment-17879974
]
Andriy Redko commented on CXF-8624:
-----------------------------------
[~Didier Loiseau] the {{JavaTimeTypesParamConverterProvider }}is a regular
JAX-RS {color:#000000}{color:#000000}ParamConverterProvider{color}{color} (see
please
[https://docs.oracle.com/javaee/7/api/javax/ws/rs/ext/ParamConverterProvider.html])
which converts from String to Java 8 JSR 310 Date Time API. I don't think we
have dedicated documentation for it at the moment.
> Is there a convenient way to generate classes using {{java.time}} without
> rolling your own adapters and bindings file?
What kind of generator you are using? cxf-wadl2java-plugin or something else?
> CXF Extension @QueryParam("") does not parse correctly LocalDate in the bean
> ----------------------------------------------------------------------------
>
> Key: CXF-8624
> URL: https://issues.apache.org/jira/browse/CXF-8624
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 3.3.12, 3.4.5
> Reporter: Anthony Durussel
> Assignee: Andriy Redko
> Priority: Major
>
> If you use the @QueryParam("") extension on a method parameter:
> {code:java}
> public void foo(@QueryParam("") Bar bar);
> {code}
> with Bar class equals to :
> {code:java}
> public class Bar {
> private LocalDate date;
> } {code}
> The URL generate from the following method parse the localDate as a standard
> object instead of singleValue as it's done for standard java.util.date
> {code:java}
> org.apache.cxf.jaxrs.utils.InjectionUtils.fillInValuesFromBean(Object,
> String, MultivaluedMap<String, Object>)
> {code}
> {code:java}
> if (isPrimitive(value.getClass()) ||
> Date.class.isAssignableFrom(value.getClass())) {
> values.putSingle(propertyName, value);
> } else if (value.getClass().isEnum()) {
> values.putSingle(propertyName, value.toString());
> } else if (isSupportedCollectionOrArray(value.getClass())) {
> final List<Object> theValues;
> if (value.getClass().isArray()) {
> theValues = Arrays.asList((Object[])value);
> } else if (value instanceof Set) {
> theValues = new ArrayList<>((Set<?>)value);
> } else {
> theValues = CastUtils.cast((List<?>)value);
> }
> values.put(propertyName, theValues);
> } else if (Map.class.isAssignableFrom(value.getClass())) {
> if (isSupportedMap(m.getGenericReturnType())) {
> Map<Object, Object> map = CastUtils.cast((Map<?, ?>)value);
> for (Map.Entry<Object, Object> entry : map.entrySet()) {
> values.add(propertyName + '.' + entry.getKey().toString(),
> entry.getValue().toString());
> }
> }
> } else {
> fillInValuesFromBean(value, propertyName, values);
> }{code}
> Ideally, we should add the LocalDate in the first "if condition" to handle it
> correctly
--
This message was sent by Atlassian Jira
(v8.20.10#820010)