forked from kongchen/swagger-jaxrs-doclet
-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
We sometimes use custom value types to enforce type safety in our model, and register converters to unwrap these values into strings. Is there any way we can have the doclet recognize these type replacements when generating the swagger documentation?
Specifically, I have something like:
public class Model {
public TechId id;
}
@XmlJavaTypeAdapter(TechId.XmlConverter.class)
public class TechId {
private final UUID uuid;
public TechId(String s) {
uuid = UUID.fromString(s);
}
@Override
public String toString() {
uuid.toString();
}
public static class XmlConverter extends XmlAdapter<String, TechId> {
@Override
public TechId unmarshal(String v) throws Exception {
return new TechId(v);
}
@Override
public String marshal(TechId v) throws Exception {
return v.toString();
}
}
}
and was hoping for the doclet to recognize the type replacement, but it didn't, i.e. the type of Model.id
is not string
, but TechId
with a property uuid
.
Metadata
Metadata
Assignees
Labels
No labels