Skip to content

Trees with two '*' keys cause unexpected keys in PUT resource #13

@abalmos

Description

@abalmos

When your tree looks like this:

 const tree = {
    bookmarks: {
      _type: "application/vnd.oada.bookmarks.1+json",
      weather: {
        _type: "application/json", // TODO: Use real MediaType
        _rev: 0,
        weather-source: {
          _type: "application/json", // TODO: Use real MediaType
          _rev: 0,
          location: {
            "*": {
              _type: "application/json", // TODO: Use real MediaType
              _rev: 0,
              "year-index": {
                "*": {
                  _type: "application/json", // TODO: Use real MediaType
                  _rev: 0,
                  "month-index": {
                    "*": {
                      "day-index": {
                        "*": {
                          _type: "application/json", // TODO: Use real MediaType
                          _rev: 0,
                          data: {},
                          template: {},
                          station: {}
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  };

and you put to a path: /bookmarks/weather/weather-source/location/8/year-index/2020/month-index/01/day-index/01

You end up with keys

"day-index": {
  "01": { 
    "_rev": 2
  }
}

under the path /bookmarks/weather/weather-source/location/8/year-index/2020, which of course is too early for an day-index based on the tree. I assume this is related to having more than one '*' in the tree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions