Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Allow only specific properties (like Grails "includes" param) #12

Open
vahidpaz opened this issue Jan 18, 2014 · 14 comments
Assignees

Comments

@vahidpaz
Copy link

I'm currently using the domain class marshalling configuration style. Are you planning to add a counterpart to "ignore" called something like "only"? This would behave like Grails 2.3 respond()'s "includes".

There are times when I want to say "only allow these properties during serialization". Currently it requires using "ignore" but with many list items.

Also, why not deprecate the use of the term "ignore" and go with Grails terminology like "excludes" and "includes"?

@ph4t
Copy link

ph4t commented Jun 4, 2014

I agree that this would be an useful feature for domain classes that have a lot of properties...

@dhalupa dhalupa self-assigned this Jun 4, 2014
@cesarhdz
Copy link

+1

@genuinefafa
Copy link

I just started using this plugin in favor over grails standard behavior.
Why won't use the same respond parameters inside the marshaller?

I can develop the feature, just need a little hint for where I should look. 😄

@aruizca
Copy link
Collaborator

aruizca commented Aug 19, 2014

Hi @genuinefafa

If you refer to this respond: http://grails.org/doc/2.3.11/ref/Controllers/respond.html, then I think this belongs to the controllers scope because it makes use of the request headers. This plugin on the other hand belongs to the domain and command objects scope.

Cheers,
Angel.

@genuinefafa
Copy link

Hi @aruizca

The respond docs are incomplete. Even the REST docs do not include those arguments, which is weird but not that strange.

The main advantage of using respond AFAIK is that it automatically chooses between as JSON or as XML.

You can see more information here or maybe check this out.

The main advantage of this plugin (grails-marshallers), for me at least, is that it allow me to make deep JSON, and set-up mapping criteria inside the Domain Class.

@immutability
Copy link
Contributor

+1 for the include option - would be more than helpful!

@immutability
Copy link
Contributor

Guys, I'm a github newbie when it comes to pull requests, and a Grails newbie at the same time. But I really needed an include mode since I have a bunch of marshallers where only id/name pairs are needed, so there was a lot of unnecessary bloat in the form of very long ignore lists.

I've got this working on my fork of the plugin (not pushed to github yet) - would you be willing to pull this change into the plugin? Right now I only have it implemented for JSON so I assume I would have to do this for XML as well. The way my implementation works is that include/ignore lists are mutually exclusive. If both are defined, then include takes priority. Let me know what you think - thanks!

immutability added a commit to immutability/grails-marshallers that referenced this issue Mar 3, 2015
immutability added a commit to immutability/grails-marshallers that referenced this issue Mar 3, 2015
…rties - issue pedjak#12) + fixed some typos in the unit test
dhalupa pushed a commit to dhalupa/grails-marshallers that referenced this issue Mar 14, 2015
dhalupa pushed a commit to dhalupa/grails-marshallers that referenced this issue Mar 14, 2015
dhalupa pushed a commit to dhalupa/grails-marshallers that referenced this issue Mar 14, 2015
@immutability
Copy link
Contributor

Guys, any chance of a new official release of the plugin (i.e. v0.7 published to the Grails plugin repository) in the near future? We'd love to avoid using a custom build for the include option. Thanks! :)

@aruizca
Copy link
Collaborator

aruizca commented Oct 23, 2015

I'll try to get it done ASAP
On 23 Oct 2015 7:30 PM, "Radoslav Bielik" notifications@github.com wrote:

Guys, any chance of a new official release of the plugin (i.e. v0.7
published to the Grails plugin repository) in the near future? We'd love to
avoid using a custom build for the include option. Thanks! :)


Reply to this email directly or view it on GitHub
#12 (comment)
.

@immutability
Copy link
Contributor

Thanks, that would be awesome!

@jerrydboonstra
Copy link

I encourage the author to release the HEAD of master as 0.7. I've forked the plugin and built my own into a private artifactory just to achieve this which everyone can benefit from.

@dhalupa
Copy link
Collaborator

dhalupa commented Mar 20, 2016

0.7 release has just been submitted for approval.

@deel77
Copy link

deel77 commented Mar 23, 2016

@dhalupa How long does it usually take for approval?

@dhalupa
Copy link
Collaborator

dhalupa commented Mar 26, 2016

On 23.03.2016 13:41, Dominik Lakatoš wrote:

@dhalupa https://github.com/dhalupa How long does it usually take
for approval?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#12 (comment)

Try leaving a comment, it might speed things up
https://grails.org/plugins/pending/1451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants