Global Exclusions

Issue #2 new
Former user created an issue

I would like to remove the "class" attribute from all of my domain classes.

This plugin have the amazing feature provided by JSON.excludeFor*.. However I would like to have a less invasive solution. I would like to remove some attributes without having to define a custom excluder... Is possible to register on bootstrap or config an option to remove the property from all classes?

The confi jsonExclusionMarshaller.globalExclusions = "attached, errors, properties, version, class, id" is suposed to provide this behavior, but it isn't working...

Comments (3)

  1. Jason Stonebraker repo owner

    I'd say to first make sure that you're using the latest version of the plugin which is 0.3. I'll take a look tonight to make sure it is working as it's supposed to though.

    Also, check out this bug report: http://jira.grails.org/browse/GRAILS-5791

    Graeme says that there are now include() and exclude() methods available for the JSON converter (though these methods probably won't make an appearance until the next release of grails). If I understand correctly, these methods will be available per instance rather than the overreaching class level methods used in the JSON Exclusion Marshaller plugin.

    In any case, the plugin might be your only option at the moment, so I'll take a look and see if I can help you out.

    Jason

  2. Former user Account Deleted

    I think there is some confusion here.

    Jason, am I correct that global exclusions does not automatically exclude the properties from all JSON renders, only when using excludeFor* calls?

  3. Jason Stonebraker repo owner

    Thank you for clearing that up Jonathan. That's correct. The global exclusions are global in the sense that they are applied to all uses of the excludeFor* calls.

  4. Log in to comment