I have been testing swagger in order to use it as the defacto documentation for my api service. I am using hibernate for the persistence layer and every response is bound to an entity. The problem is that those entities have dependencies with other entities and I would like to orchestrate swagger to not show those entities when I pass the object in the @ApiOperation response. The only think I could find on line is this link from the github page.
I have tried doing this:
String emptyJSON = "{}";
OverrideConverter addressConverter = new OverrideConverter();
addressConverter.add(User.class.getCanonicalName(), emptyJSON);
ModelConverters.addConverter(addressConverter, true);
but I am getting this error:
org.json4s.package$MappingException: Did not find value which can be converted into java.lang.String
Is there a way to avoid serializing some classes when I find them as fields or in lists and how?