First of all sorry because my english is not the best.
Im working with Misd-Guzzle Bundle and JMSerializer but I dont know how to solve this problem.
The point is that i need to parse the response im getting when i send a request to the API.
I have this:
"GetAddresses": {
"httpMethod": "GET",
"uri": "/tads",
"summary": "Returns all the addresses registered in API",
"responseClass": "array<AppBundle\\Entity\\Address>"
}
However the API returns this:
- {
- "_links":
- {
- "self":
- {
- "href": "http://api.hscode09bids.com/tads?page=1"
- },
- "first":
- {
- "href": "http://api.hscode09bids.com/tads"
- },
- "last":
- {
- "href": "http://api.hscode09bids.com/tads?page=1"
- }
- },
- "_embedded":
- {
- "tads":
- [
- {
- "id": "1",
- "adsName": "Street",
- "adsCity": "Havana",
- "adsState": "Arroyo",
- "adsZipCode": "10400",
- "adsCtyId": "1"
- },
- {
- "id": "0",
- "adsName": "Street2",
- "adsCity": "Havana2",
- "adsState": "Arroyo2",
- "adsZipCode": "10401",
- "adsCtyId": "2"
- },
- {
- "id": "2",
- "adsName": "Street3",
- "adsCity": "Havana3",
- "adsState": "Arroyo3",
- "adsZipCode": "10403",
- "adsCtyId": "3"
- }
- ]
- },
- "page_count": 1,
- "page_size": 25,
- "total_items": 5
- }
How can i say to my entity Address that the element to take into account is "tads" and not the complete response.
Or maybe parse this response for making "tads" array value the response I need.
I'd really appreciate your help.