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

Validate @id references in Slots and ScheduledSession feeds #408

Open
civsiv opened this issue May 5, 2022 · 0 comments
Open

Validate @id references in Slots and ScheduledSession feeds #408

civsiv opened this issue May 5, 2022 · 0 comments

Comments

@civsiv
Copy link
Contributor

civsiv commented May 5, 2022

In certain contexts some fields must have compact @id references instead of the data object. This card is related #402 which was fixed by #407

For the Slots feed, the correct implementation is

"facilityUse": "https://localhost/ven_000229-rbt_000010",

The below example is incorrect:

"facilityUse":{
               "@type":"FacilityUse",
               "@id":"https://localhost/ven_000229-rbt_000010",
               "identifier":"ven_000229-rbt_000010"
            },

This is also the case for a ScheduledSession feed of RPDE kind: ScheduledSession but not RPDE kind:ScheduledSession.SessionSeries. Examples below:

// Valid
{
    "kind": "ScheduledSession",
    "data": {
        "@type": "ScheduledSession",
        "superEvent": "https://example.com/SessionSeries/1"
        ...
    },
    ...
}

// Invalid
{
    "kind": "ScheduledSession",
    "data": {
        "@type": "ScheduledSession",
        "superEvent": {
            "@type": "SessionSeries",
            "@id": "https://example.com/SessionSeries/1"
            ...
        }
        ...
    },
    ...
}

// Valid
{
    "kind": "ScheduledSession.SessionSeries",
    "data": {
        "@type": "ScheduledSession",
        "superEvent": {
            "@type": "SessionSeries",
            "@id": "https://example.com/SessionSeries/1"
            ...
        }
        ...
    },
    ...
}

Validator

Therefore in order to implement @id reference validation with feed context, the rule must use the kind to determine what is valid, and therefore kind must be passed into the .validate() function options when used.

Test Suite

To finish this task, Test Suite must pass kind where it validates the feeds in order to ensure that the Slots and ScheduledSession feeds are fully validated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant