Examples of excluding certain types in model schemas
I chatted with @fehguy on IRC to find a valid approach for filtering unnecessary key-values and JSON nodes away from the model schema. Here's a picture of what I'm aiming to do:

There are two approaches to this problem. One option is to override the model completely. The other option is to implement a ModelConverter, where one can choose what field types to exclude.
Can you guys please provide examples of excluding certain types? Thanks!
PS: I'm using the java-play2 framework
Just pushed a unit test (and a fix) to do this:
https://github.com/wordnik/swagger-core/blob/develop/modules/swagger-core/src/test/scala/converter/CustomConverterTest.scala#L47
This is being deployed to 1.3.1-SNAPSHOT in sonatype right now.
looks like that caused a test regression. Will update shortly
Thanks for attending this issue. Waiting for your update.
added example and uploaded an update to swagger-core-1.3.1-SNAPSHOT to support a new field type:
https://github.com/wordnik/swagger-core/wiki/Overriding-Models
Hi fehguy, the converter approach looks good.can you plz let us know where to add that piece of code in playframework ( in swagger classes o anywhere else) .we are using swagger 1.2.5
Hi, you can get it in swagger-play2-1.3.1, which is now on maven central.
Hi,
By adding the below code in swagger.js, we can avoid unnecessary key-values and JSON nodes.
//Add below code in getMockSignature function to avoid unnecessary occurrence of model properties.
var str=returnVal.search("<span class=\"strong\">EntityBeanIntercept {");
if(str==0){
return "";
}
else{
returnVal=returnVal.replace("<div><span class=\"propName propOpt\">_ebean_intercept</span> (<span class=\"propType\">EntityBeanIntercept</span>, <span class=\"propOptKey\">optional</span>),</div>","");
return returnVal;
}
//Add below code in createJSONSample function to avoid unnecessary occurrence of JSON node
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
prop = _ref[_i];
if(prop.name!="_ebean_intercept"){
result[prop.name] = prop.getSampleValue(modelsToIgnore);
}
}
this definitely will clean things up in the UI. But if you use the client generators, etc., you'll have the same problem. I think the best thing to do is the model converter technique.