greptilian logo

IRC log for #rest, 2015-02-04

https://trygvis.io/rest-wiki/

| Channels | #rest index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
00:18 lebster joined #rest
00:38 talios joined #rest
01:01 shrink0r_ joined #rest
01:05 shrink0r joined #rest
01:07 shrink0r_ joined #rest
01:33 proteusguy joined #rest
01:46 shrink0r joined #rest
02:09 shrink0r_ joined #rest
02:22 Angry_Roy_Fieldi joined #rest
02:47 lemur joined #rest
03:11 fragamus joined #rest
03:41 shrink0r joined #rest
03:43 shrink0r_ joined #rest
03:49 MLMitch joined #rest
03:55 shrink0r joined #rest
03:57 shrink0r_ joined #rest
04:49 fragamus joined #rest
05:14 shrink0r joined #rest
05:16 shrink0r_ joined #rest
05:21 proteusguy joined #rest
06:05 proteusguy joined #rest
06:39 shrink0r joined #rest
06:41 shrink0r_ joined #rest
06:55 _ollie joined #rest
07:37 fragamus joined #rest
07:40 adaro joined #rest
07:47 Andre-B joined #rest
07:55 proteusguy joined #rest
08:03 _ollie joined #rest
08:12 adaro joined #rest
08:31 rosstuck joined #rest
08:38 graste joined #rest
08:39 Andre-B joined #rest
09:40 quimrstorres joined #rest
09:48 quimrstorres joined #rest
10:16 martinfilliau joined #rest
10:46 Left_Turn joined #rest
11:01 Left_Turn joined #rest
11:27 shrink0r joined #rest
11:54 mezod joined #rest
12:16 sulky_ joined #rest
12:27 proteusguy joined #rest
12:27 pdurbin joined #rest
13:20 Andre-B_ joined #rest
13:21 nkoza joined #rest
13:31 Mxyzpltk joined #rest
13:44 Mxyzpltk joined #rest
14:20 Mxyzpltk_ joined #rest
14:30 quimrstorres joined #rest
14:33 Mxyzpltk_ joined #rest
14:37 curiousmansi joined #rest
14:37 curiousmansi guys i am using chrome rest client extension
14:37 curiousmansi i want to use some of the public api say anything like google, foursqaure or anything. For those api to use i need to have some oath authentication steps to follow to get access_token
14:38 curiousmansi i have trouble generating the access_token
14:38 curiousmansi any help around
15:06 pdurbin curiousmansi: it's pretty easy to generate a GitHub token. just click a button
15:14 graste joined #rest
15:32 graste joined #rest
15:38 fragamus joined #rest
16:35 Mxyzpltk joined #rest
16:41 DrCode joined #rest
16:47 Mxyzpltk joined #rest
16:54 Mxyzpltk joined #rest
16:55 proteusguy joined #rest
17:07 apennebaker-ni joined #rest
17:30 trygvis has anyone tried spring-hateoas?
17:34 _ollie I built it :)
17:35 _ollie so: yes
17:35 lemur joined #rest
17:35 trygvis orly
17:37 trygvis how does one do embedded resources?
17:37 whartung _ollie: so, do you like it?
17:38 _ollie whartung: sort of :) I know the areas that need improvement for sure…
17:38 whartung :)
17:39 trygvis and, is there any documentation available?
17:40 _ollie the readme it is…
17:41 _ollie if you use a Resources instances the _embedded clause should be rendered as you expect it
17:41 whartung Open Source: Ship it, Test it, Document it -- in taht order, if you get that far
17:42 _ollie It's basically a byproduct of Spring Data REST, as we considered it generally useful for other's, too.
17:42 trygvis how do I control the name of the rel in the embedded resource map?
17:44 trygvis whartung: no documentation means no outdated documentation!
17:44 _ollie By default its using the simple type name
17:44 whartung That's the spirit!
17:44 _ollie If you want more control use EmbeddedWrappers.wrap(object, rel)
17:54 Mxyzpltk joined #rest
18:13 fragamus joined #rest
18:15 mezod joined #rest
18:31 trygvis hm, I'm confused
18:38 _ollie how?
18:39 trygvis do you have an example of how I can create a response with an _embedded element and a rel that makes sense?
18:39 _ollie define "makes sense"…
18:39 _ollie "manually defined"?
18:40 trygvis we can start with manually defined
18:41 trygvis http://pastie.org/private/mfzffgshygvzpmwsrww5g
18:42 trygvis am I missing a serializer for the EmbeddedWrappers variant?
18:44 _ollie https://gist.github.com/olivergierke/3b74bff2fbf87cc1d53a
18:47 trygvis great, thanks!
18:54 _ollie Might look a bit more convoluted than expected but EmbeddedWrappers is more of a config class so it can be held in a controller or the like…
18:54 trygvis so with the assembler, should it be: return new Resources<>(asList(wrappers.wrap​(assembler.toResources(devices), "someRel"))); ?
18:55 _ollie Also, keep in mind, that we're not a HAL library per se, so "embedding" something is not a first class citizen really. We're rather providing an API that allows you to produce objects that will render in HAL compatible fashion
18:56 trygvis yeah, I can feel the tension
18:58 _ollie we usually see people mapping types to rels so you can leave away all the EmbeddedWrappers dance if you can just live with the type name be used as rel or to a type based RelProvider implementation that will give you control over the rels on a per-type base
18:59 trygvis I'm not sure what to do with the rels, I find HAL's way of relating stuff strange
19:00 _ollie I started liking if once I got used to it (Stockholm syndrome?)
19:01 _ollie most people have collections with unique elements anyway so the additional nesting doesn't add any benefit here. It starts to make sense though if you list objects of different kinds…
19:01 fragamus joined #rest
19:12 diegoaguilar joined #rest
19:13 trygvis hm, is there a reason why EmbeddedWrapper isn't typed?
19:18 trygvis _ollie: I'm getting "Collection must not be empty" with that
19:18 trygvis with that line, which is a bit odd
19:36 _ollie with what line? do you have a stack trace handy?
19:37 trygvis it's from the constructor of EmbeddedCollection
19:37 trygvis it happens when I use EmbeddedWrappers.wrap() with an empty collection
19:38 trygvis I'm using 0.16.0.RELESAE
19:39 _ollie so toResources returns an empty collection?
19:39 trygvis no, my input devices list is empty
19:40 _ollie and you'd still like to get an _embedded : { someRel : [] }?
19:42 trygvis well, ideally it wouldn't be there if the list is empty, but that is better than an exception :)
19:42 trygvis without being an expert in HAL I assume there is no semantic difference between an empty list and a missing list
19:43 _ollie you could skip the entire mapping step if the devices list is empty in the first place
19:45 trygvis I could, but I honestly assumed that this would be handled for me
19:45 Andre-B joined #rest
19:45 _ollie please create a ticket
19:46 quimrsto_ joined #rest
19:47 _ollie although I am a bit torn of whether to include an empty collection or skip the element entirely
19:48 trygvis is the github the repository the issue tracker you use?
19:48 _ollie yes
19:49 shrink0r joined #rest
19:54 trygvis how would you make a object with embedded resources?
19:54 trygvis in my case I have a Device that has a list of Sensor objects which I want to be embedded
19:56 _ollie You'd have a sub-class of Resource<T> and add a property of type Resources<EmbeddedWrapper>
19:57 trygvis the Resource class is strange, I'm supposed to extend it *and* provide a object that it wraps
19:58 _ollie no…
19:58 _ollie as I mentioned, it's not designed with embedding in mind as not all of the hypermedia types have this concept
19:59 _ollie it exists to unwrap the contained object into the root document and add links
19:59 trygvis I realize, but the class is still strange
19:59 _ollie it has one purpose: enrich an exiting domain object with links, nothing more.
20:00 _ollie existing
20:00 trygvis right, so I can't see how I'm supposed to use it if I'm extending it.
20:00 trygvis I can't pass 'this' to super()
20:00 _ollie you just forward the payload to the superclass
20:02 _ollie you besically delegate the entire consutuctor call and add means to add embedded elements after construction
20:02 _ollie basically
20:02 trygvis I assumed 'this' would be the payload if my class extended Resource
20:02 _ollie I don't get what you refer to with "this"
20:03 trygvis I don't understand how I should extend Resource. I though I was supposed to create DeviceResource that extends Resource and that I would create a DeviceResource from a Device
20:04 trygvis Device has a List<Sensor>
20:05 _ollie oh, I see… you'd need to mark those with @JsonIgnore and manually add the sensors as embeddeds…
20:07 trygvis this won't work: http://pastie.org/private/lkh6w3sasf0gz54z81sca
20:07 trygvis but I assumed that was the pattern you wanted me to follow
20:08 _ollie well, you'll need to invoke a super constructor…
20:09 trygvis yeah, and that won't work..
20:09 trygvis because I want to pass 'this'
20:10 _ollie but why? that doesn't make any sense…
20:10 _ollie you'd pass device…
20:10 trygvis no, device is my @Entity
20:11 _ollie I know…
20:11 trygvis yeah, that is not happening
20:11 _ollie that's what I am saying for 20 minutes now…
20:11 _ollie Resource is supposed to wrap entities
20:12 trygvis yeah, I'm not going to expose my entities directly to the world
20:13 _ollie that's basically the opposite of what you asked for:
20:13 _ollie how would you make a object with embedded resources?
20:13 _ollie 20:54 trygvis: in my case I have a Device that has a list of Sensor objects which I want to be embedded
20:14 _ollie if you don't want to wrap the domain object directly, rather extend ResourceSupport and add properties they way you like…
20:14 trygvis that is what I am doing
20:25 Mxyzpltk joined #rest
21:56 quimrstorres joined #rest
22:06 fragamus joined #rest
22:46 daxim joined #rest
22:58 quimrstorres joined #rest
23:05 Mxyzpltk joined #rest
23:26 shrink0r_ joined #rest
23:27 quimrstorres joined #rest
23:42 shrink0r joined #rest

| Channels | #rest index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

https://trygvis.io/rest-wiki/