Fork me on GitHub
#yada
<
2017-04-10
>
danielcompton01:04:53

This can be handled through adding judicious logging interceptors into the right place in the chain

dominicm07:04:02

I'd also recommend tcpdump in such situations.

borkdude08:04:16

@malcolmsparks I’d like to pass the option to cheshire to escape non-ascii characters. I see there is another option pretty that is activated like this: https://github.com/juxt/yada/blob/432d1b25f83a4af5d94d1108f37ee253a2a74bce/ext/swagger/src/yada/swagger.clj#L169

borkdude08:04:55

@malcolmsparks Would a PR that adds the non-ascii option to this make sense? Or is the pretty parameter something HTTP specific?

danielcompton11:04:13

@malcolmsparks think that has to be a record for my fastest PR merged 🙂

malcolmsparks11:04:50

also factoring in the speed-of-light between NZ and MK 🙂

dominicm11:04:14

Pieter Hintjens had this philosophy of merging all PRs immediately, he would review them later, and make a reverting PR if he didn't like it.

dominicm11:04:59

Used on ZMQ

dominicm11:04:40

His daughter, non-programmer, had merging rights.

danielcompton11:04:42

Yeah it's an interesting philosophy, lots to like about it

ordnungswidrig12:04:03

I’m thinking of using that strategy in the liberator project because I hope for a smaller backlog. However, I think it wouldn’t save me any time because I had to review and fix stuff anyways. Still a very interesting idea, I think it would lower the barrier for new developers actually becoming involved into the project.

malcolmsparks12:04:32

my daughter is 4, I'm going to give her yada merging rights (as soon as she gets her github id)

malcolmsparks18:04:37

lots of thoughts, hard to type on a phone... :)

malcolmsparks18:04:06

JSON mimetype is application/json. No parameters registered.

borkdude18:04:29

@malcolmsparks Didn’t know you were on a phone, it can wait 🙂

malcolmsparks18:04:37

So pretty is a poor hcck

borkdude18:04:07

@malcolmsparks I’m looking for a better solution than to override all the defmethods

malcolmsparks19:04:32

I'm curious about non-ascii chars. What is the driver for this? JSON is utf8 (or utf16/utf32 if you add a byteorder mark), but utf nonetheless

malcolmsparks19:04:29

But you can use defmethod to override yada's default handling of application/json. I think Clojure's multimethods give yada an extensibility that is hard to achieve so easily and elegantly in other frameworks

malcolmsparks19:04:31

For pretty and other parameters of application/json we need a new media-type such as vnc.yada/json or alternatives

borkdude19:04:07

(the line after where the link points to)

borkdude19:04:26

Our ClojureScript app crashes on the response with the line separator in it

borkdude19:04:15

I think I’ll just go for the defmethod approach then

malcolmsparks19:04:00

Oh ok. I understand now. Thanks!

malcolmsparks19:04:00

Do you think yada should escape by default?. This seems like something that should be the default

borkdude19:04:25

To reproduce, just paste this `txt = "Text
"` in your Chrome JS console

borkdude19:04:04

@malcolmsparks I’m not sure. Maybe we could make it more flexible by allowing :cheshire/escape-non-ascii and :cheshire/pretty keys on the resource

borkdude19:04:44

Not sure if that’s a hack

malcolmsparks19:04:52

Hmm. Good idea. Like the namespaced keys idea. Perhaps yada.chesire to avoid ownership issues.

malcolmsparks19:04:32

This opens up a lot of interesting possibilities with yada resource models