localhots / musicbrainz

MusicBrainz Web Service client
https://musicbrainz.org/doc/MusicBrainz_API
MIT License
63 stars 40 forks source link

Use JSON api format instead of XML #20

Open localhots opened 11 years ago

localhots commented 11 years ago

It should be way easier to parse and a lot faster

Here's the documentation: http://wiki.musicbrainz.org/Development/JSON_Web_Service

volontarian commented 11 years ago

I would also prefer JSON over XML and will maybe build a prototype some day to see the advantages.

I currently implemented an alternative to pure XML mapping with XML mapping through XSL transformation in branch 0.8.0.rc1 which gives us a higher coverage of the MusicBrainz schema with less code but maybe less maintainability. So I am not convinced by my solution yet, just an experiment and not planned to merge in the master that soon.

So this solution transforms the official XML schema trough this hardly readable but rspec covered XSL into this simpler XML schema.

bin/generate_mappers.rb generates the roxml mapper code from the simple XML schema mentioned above under /lib/musicbrainz/mapper/resources and models under /lib/musicbrainz/models.

localhots commented 11 years ago

Sounds like a plan. I'll look into that

inkstak commented 11 years ago

Hi, I've started working on using the JSON api here : inkstak@1f43001d24621e26f8e1769dc8214380a97a57d8

I've done a big rewrite job on models, to allow a better use of inc arguments. I hope I'll complete that in the coming days : more inc cases, specs and docs..

williscool commented 10 years ago

@inkstak can you put 1f43001d24621e26f8e1769dc8214380a97a57d8 on a branch and push it?

for some reason when I pull from this repo as a remote from my fork that commit doesn't show up

I want to run with it and finish it.

I was about to do alot of this work myself because I've got an app I want to use the json api with

williscool commented 10 years ago

nevermind found it... so weird that github's ui links to the commit localhots repo but it doesn't exist there only in your fork

inkstak commented 10 years ago

Sorry. This camed from Github quick links when filling 1f4300... instead of inkstak@1f4300...