Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

belipero's avatar

Inbound JSON API Data Mapping & Transformation Simplified

Hi!

I have an inbound API to develop on our app and we want to simplify our code regarding data mapping/transformation. The JSON message will contain many elements and nested arrays. So as we don't want to deploy new code when a value changes in API outiside origin, we want to solve data transformation in some file or table that we can quicky edit/add value so new code is not needed.

For example, in tags element, we will have multiple values that we need to transform and we want to do it outside code so it's easy for us to mantain the API data mapping without releasing new code.

We know about Resources but it will be a coding approach.

Does anyone has made a similar development for this requirement?

Regards

 "objects": 
    {
      "address": "Address", 
      "age": 0, 
      "bathroom_amount": 0, 
      "branch": {
        "address": "Juramento 1111", 
        "alternative_phone": "1111111", 
        "alternative_phone_area": "11", 
        "alternative_phone_country_code": "+549", 
        "alternative_phone_extension": "", 
        "branch_type": "Internal", 
        "contact_time": "9 a 19 hs", 
        "created_date": "2020-02-27T19:52:39", 
        "display_name": "Juan Pablo", 
        "email": "[email protected]", 
        "geo_lat": "-34.556", 
        "geo_long": "-58.447", 
        "gm_location_type": "ROOFTOP", 
        "id": 17661, 
        "is_default": false, 
        "logo": "https://domain/logograndesuma.jpg", 
        "name": "Example", 
        "pdf_footer_text": "Footer", 
        "phone": "11111", 
        "phone_area": "11", 
        "phone_extension": "", 
        "use_pdf_footer": true
      }, 
      "company": {
        "contact_info": "", 
        "key": "11111111", 
        "logo": "https://domain/image.jpg", 
        "name": "Keller Williams BA"
      },
      "created_at": "2020-02-27T19:52:37", 
      "custom1": "0.00", 
      "custom_tags": [], 
      "deleted_at": "2020-03-10T21:02:45", 
      "description": "Description", 
      "development": null
      "tags": [
        {
          "id": 5, 
          "name": "Electricidad", 
          "type": 1
        }, 
        {
          "id": 6, 
          "name": "Pavimento", 
          "type": 1
        }
      ]
}
0 likes
2 replies

Please or to participate in this conversation.