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

arccore.filter keys cannot contain period(s) characters #3

Open
ChrisRus opened this issue Dec 20, 2021 · 0 comments
Open

arccore.filter keys cannot contain period(s) characters #3

ChrisRus opened this issue Dec 20, 2021 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@ChrisRus
Copy link
Member

I noticed an interesting (and potentially exceptionally confusing) error string back from filter recently.

{
    ____types: "jsObject",
    ____asMap: true,
    key: {
        ____types: "jsObject",
        required: {
            ____accept: "jsString"
         }
    }
}

Now suppose I create an object that looks like this:

{
    "~.this.is.a.path.into.cds.instance.data.used.as.a.key": { /* whoops */ )
}

missing ~.this.is.a.path.into.cds.instance.data.used.as.a.key.required <--- wat

What to do about this? n JavaScript we can write:

let x = {};
x["~.whatever.i.want"] = 5

RAP: [ "whatever.i.want" ]
RIS: "~.[whatever.i.want]"

I'm not sure. I've got a whole system all worked out for ARC RIS and RAP --- I just can't recall the exact details.

In the short term I think it's prudent to **advise against ** using map/dictionary keys that contain period (.) character(s). arccore.identifier.irut.fromReference (or alternative) function is available to quickly hash strings that may contain forbidden characters.

Leaving this open in case anyone hits this case. DO NOT USE period characters in keys; if you have to deal with keys that do or may contain periods, convert them to IRUT digest hash strings (or use some other appropriate mechanism to remove the periods).

@ChrisRus ChrisRus added the documentation Improvements or additions to documentation label Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant