mercredi 28 juin 2017

Ember Serialize 'ID'

I'm making an API call in Ember and the API I'm hitting is returning some JSON with 'ID' capitalized, it seems Ember is looking for lowercase 'id.' Everything else should work, so how would I serialize just this one piece of JSON in this instance?

See JSON below.

{ "ID": 2, "name": "Main Menu", "slug": "main-menu", "description": "", "count": 4, "items": [ { "id": 11, "order": 1, "parent": 0, "title": "Contact", "url": "http://localhost:8888/contact/", "attr": "", "target": "", "classes": "", "xfn": "", "description": "", "object_id": 7, "object": "page", "object_slug": "contact", "type": "post_type", "type_label": "Page" }, { "id": 12, "order": 2, "parent": 0, "title": "About", "url": "http://localhost:8888/about/", "attr": "", "target": "", "classes": "", "xfn": "", "description": "", "object_id": 5, "object": "page", "object_slug": "about", "type": "post_type", "type_label": "Page", "children": [ { "id": 21, "order": 3, "parent": 12, "title": "About Us – Sub", "url": "http://localhost:8888/about/about-us-sub/", "attr": "", "target": "", "classes": "", "xfn": "", "description": "", "object_id": 9, "object": "page", "object_slug": "about-us-sub", "type": "post_type", "type_label": "Page" } ] }, { "id": 13, "order": 4, "parent": 0, "title": "Home", "url": "http://localhost:8888/home/", "attr": "", "target": "", "classes": "", "xfn": "", "description": "", "object_id": 2, "object": "page", "object_slug": "home", "type": "post_type", "type_label": "Page" } ], "meta": { "links": { "collection": "http://localhost:8888/wp-json/wp/v2/menus/", "self": "http://localhost:8888/wp-json/wp/v2/menus/2" } } }




Aucun commentaire:

Enregistrer un commentaire