vendredi 27 juin 2014

Swagger is showing _ebean_intercept with everymodel in my play application


Vote count:

0




I am integrating swagger into my play application. It works fine. ( Play 2.2 + swagger 1.3.3 )


Although for every model it adds a field which I need to hide


Classification { id (integer, optional), type (string, optional), shortCode (string, optional), active (boolean, optional), _ebean_intercept (EntityBeanIntercept, optional) }


I created a custom converter in Scala ( My app is written in Java by the way )



class IgnoreConverter extends SwaggerSchemaConverter {
override def skippedClasses: Set[String] = Set("com.avaje.ebean.bean.EntityBeanIntercept")
override def ignoredClasses: Set[String] = Set("com.avaje.ebean.bean.EntityBeanIntercept")
override def ignoredPackages: Set[String] = Set("com.avaje.ebean")
}


I am adding this converter when the Play app is loaded via Globals.java



@Override
public void onStart(Application application) {
Logger.info("Registering custom converter");
//HideModelConverter converter = new HideModelConverter();
IgnoreConverter converter = new IgnoreConverter();

ModelConverters.addConverter(converter, true);


Still no luck.


Can someone give me some ideas where I should look ?


How can I hide fields, classes, packages from Swagger's from introspection ? Why is Swagger ignoring my converter ?


Thanks for any help



asked 32 secs ago






Aucun commentaire:

Enregistrer un commentaire