curator icon indicating copy to clipboard operation
curator copied to clipboard

Allow complex payload

Open BernhardBln opened this issue 10 years ago • 5 comments

Hi, why is the payload limited to strings?

You could also allow to pass a map or an array, right? (And the json serialiser used by curator discovery should take care of it?)

I'm actually running into a problem as I have other services that have some json in the payload, and curator discovery tries to deserialise the json but then cast it to string. But of course I'd like to pass a map as payload too.

Or am I just doing something wrong in the initialisation?

Bernhard

BernhardBln avatar Aug 19 '15 16:08 BernhardBln

Hi,

Really sorry but it's been so long since I've looked at Curator that I can't remember why- as you say, makes more sense it would accept anything.

Perhaps you could make some changes and send a pull request?

Thanks Paul

pingles avatar Aug 21 '15 08:08 pingles

Well, I can try - I only started writing my first line of clojure code last week, so I will try to see how far I can get with that ;-) I'll let you know.

Bernhard

BernhardBln avatar Aug 21 '15 10:08 BernhardBln

Awesome- let me know how/when I can help.

On Fri, Aug 21, 2015 at 11:10 AM, Bernhard Streit [email protected] wrote:

Well, I can try - I only started writing my first line of clojure code last week, so I will try to see how far I can get with that ;-) I'll let you know.

Bernhard

— Reply to this email directly or view it on GitHub https://github.com/pingles/curator/issues/5#issuecomment-133363259.

pingles avatar Aug 21 '15 10:08 pingles

Thanks, actually it went faster than I expected - will send you a pull request.

I'm really an absolute beginner with Clojure, so feel free to change the code ;-)

I changed the version to 1.0.0 as it introduces a breaking change (you cannot simply pass a string any more as payload, unless you provide your own serializer)

BernhardBln avatar Aug 21 '15 13:08 BernhardBln

See https://github.com/pingles/curator/pull/7

BernhardBln avatar Aug 21 '15 13:08 BernhardBln