Skip to content

unflatten data attribute keys to get pretty response

Neelesh Thakur requested to merge pretty-response into master

Make Search service response pretty:

Current sample response:

{
  "results": [
    {
      "data": {
        "relationships.definitiveTrajectory.id": "opendes:trajectory:0ed0164d-bd45-43ad-8fef-0fcec0d9fd87_trajectory",
        "relationships.tieInWellbore.version": 0,
        "relationships.tieInWellbore.confidence": 0,
        "relationships.definitiveTrajectory.confidence": 0,
        "relationships.definitiveTrajectory.version": 0,
        "name": "4900105093"
      },
      "kind": "opendes:petrel:wellbore:1.0.6"
    }
  ]
}

With this change, formatted search service response:

{
  "results": [
    {
      "data": {
        "relationships": {
          "definitiveTrajectory": {
            "id": "opendes:trajectory:0ed0164d-bd45-43ad-8fef-0fcec0d9fd87_trajectory",
            "confidence": 0,
            "version": 0
          },
          "tieInWellbore": {
            "version": 0,
            "confidence": 0
          }
        },
        "name": "4900105093"
      },
      "kind": "opendes:petrel:wellbore:1.0.6"
    }
  ]
}

Related core-common MR: 117

Edited by Neelesh Thakur

Merge request reports

Loading