Skip to content
This repository was archived by the owner on Jan 27, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

package com.sun.jersey.server.wadl;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -165,9 +167,14 @@ public Param createParam( AbstractResource r, AbstractMethod m, final Parameter
if (p.hasDefaultValue())
wadlParam.setDefault(p.getDefaultValue());
Class<?> pClass = p.getParameterClass();
if (pClass.isArray()) {
if (Iterable.class.isAssignableFrom(pClass)) {
wadlParam.setRepeating(true);
pClass = pClass.getComponentType();
if (p.getParameterType() instanceof ParameterizedType) {
final Type[] actualTypeArguments = ((ParameterizedType) p.getParameterType()).getActualTypeArguments();
if (actualTypeArguments.length == 1) {
pClass = (Class<?>) actualTypeArguments[0];
}
}
}
if (pClass.equals(int.class) || pClass.equals(Integer.class))
wadlParam.setType(new QName("http://www.w3.org/2001/XMLSchema", "int", "xs"));
Expand Down