Google Groups

Re: hypermedia json forms


Mike Kelly May 24, 2012 8:38 AM
Posted in group: API Craft
Not right now, but halo+json is a new media type I'm designing now that's based on hal+json

hal+json is already in use, there's a number of libraries that exist for it:


and here's one example of how it's being used in the wild:


Cheers,
M

On Thu, May 24, 2012 at 4:26 PM, Terren Suydam <terren...@gmail.com> wrote:
That's helpful... are there real-world examples of APIs using either
collections or halo?

Thanks,
Terren

On Thu, May 24, 2012 at 11:07 AM, Mike Kelly <mikeke...@gmail.com> wrote:
> Hey Terren,
>
> I'm currently working on a new media type halo+json which I think provides
> some of the form capabilities you are looking for:
>
> https://gist.github.com/893552
>
> Cheers,
> Mike
>
>
> On Thu, May 24, 2012 at 4:00 PM, Terren Suydam <terren...@gmail.com>
> wrote:
>>
>> I'm trying to decide whether to do a hypermedia response or force
>> client developers to do url construction. I love the idea of providing
>> links in the response, and for GETs nothing could be simpler. But for
>> updates (of whatever kind) the situation is more muddled. Even for
>> simple examples like below it seems to me the API developers that
>> might use my API would have an easier time with URL construction -
>> unless there were some standard out there with library support for
>> client devs.
>>
>> Off the top of my head I'm looking for public examples that *might*
>> look something like this:
>>
>> GET http://.../resources/123
>> ...
>> update: {
>>  verb: PUT
>>  params: [
>>    {name: field1, type: string, max-length: 64, mandatory: true},
>>    {name: field2, type: integer, min-value: 0, max-value: 100},
>>    // and so on with potentially many kinds of parameter types and
>> constraints
>>  ]
>> }
>>
>> On Thu, May 24, 2012 at 10:40 AM, mca <m...@amundsen.com> wrote:
>> > Terren:
>> >
>> > Not sure if this is what you are asking, but you can checkout my
>> > Collection+JSON hypermedia design[1]. I also posted a sample generic JS
>> > client (in github[2]) that generates HTML.FORM elements "on the fly"
>> > based
>> > on the JSON representation returned to the client.
>> >
>> > Even if this is not exactly what you need, it might give you some ideas
>> > on
>> > how to tackle your own problem.
>> >
>> > Feel free to write me directly if you have questions specific to the
>> > media
>> > type.
>> >
>> > [1]  http://amundsen.com/media-types/collection/
>> > [2]  https://github.com/mamund/collection-json
>> >
>> > mca
>> > http://amundsen.com/blog/
>> > http://twitter.com@mamund
>> > http://mamund.com/foaf.rdf#me
>> >
>> >
>> >
>> >
>> > On Thu, May 24, 2012 at 10:32 AM, Terren Suydam
>> > <terren...@gmail.com>
>> > wrote:
>> >>
>> >>
>> >> Hi all,
>> >>
>> >> Wondering if there's any decent public APIs out there that demonstrate
>> >> hypermedia responses (in JSON) that construct forms for updating data.
>> >> Anyone know of any?
>> >>
>> >> Thanks,
>> >> Terren
>> >
>> >
>
>
>
>
> --
> Mike
>
> http://twitter.com/mikekelly85
> http://github.com/mikekelly
> http://linkedin.com/in/mikekelly123



--
Mike

http://twitter.com/mikekelly85
http://github.com/mikekelly
http://linkedin.com/in/mikekelly123