Skip to content

fix path in schema parser for attributes marked nested by x-osdu-indexing

Neelesh Thakur requested to merge nested-schema into master

Addresses: 61

Fix indexer schema parser to handle nested attribute decorated with x-osdu-indexing. Currently they only work with one level nesting.

As an example consider following schema fragment and we want to find geopoliticalContext attribute schema:

 "classification": {
          "type": "object",
          "title": "File Properties",
          "properties": {
            "petro": {
              "description": "Represents petro",
              "title": "petro",
              "type": "Object",
              "properties": {
                "geopoliticalContext": {
                  "description": "Represents value of geopoliticalContext",
                  "title": "geopoliticalContext",
                  "type": "array",
                  "x-osdu-indexing": {
                    "type": "nested"
                  },
                  "items": {
                    "type": "object",
                    "properties": {
                      "country": {
                        "title": "country",
                        "type": "string",
                        "description": "Represents country"
                      }
                    }
                  }
               }

should be flattened as:

{
      "path": "classification.petro.geopoliticalContext",
      "kind": "nested",
      "properties": [
        {
          "path": "country",
          "kind": "string"
        }
      ]
}

instead of (this is the current behavior)

{
      "path": "geopoliticalContext",
      "kind": "nested",
      "properties": [
        {
          "path": "country",
          "kind": "string"
        }
      ]
}
Edited by Neelesh Thakur

Merge request reports