Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
abalmos opened this issue Feb 12, 2020 · 4 comments
Open

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

abalmos opened this issue Feb 12, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@abalmos
Copy link
Member

abalmos commented Feb 12, 2020

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.

@abalmos abalmos added the bug Something isn't working label Feb 12, 2020
@tomohiroarakawa
Copy link
Member

I tried the PUT request with the tree posted above, but I have not been able to reproduce the problem. Just curious, are you using oada-cache with the cache option turned on?

@abalmos
Copy link
Member Author

abalmos commented Feb 13, 2020

I have been using it with cache: false@sanoel was able to reproduce. Maybe he has a simpler case.

@aultac
Copy link
Member

aultac commented Feb 13, 2020 via email

@tomohiroarakawa
Copy link
Member

@abalmos Thanks. I will ask @sanoel .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants