w3c / pub-manifest

W3C Publication Manifest
https://w3c.github.io/pub-manifest
Other
7 stars 16 forks source link

Fix variable in recursive normalization #234

Closed naglis closed 4 years ago

naglis commented 4 years ago

At 7.4.1 step 9.a.i, if normalized is a list containing item map, e.g.:

[
    {
        "type": [
            "Person"
        ],
        "name": "Herman Melville"
    }
]

it seems that context for the recursive normalize data call should be item["type"], not keyValue["item"]. In this case, context would be Person.

Same applies for step 9.b.i.

It appears item["type"] is being used in the reference implementation:

https://github.com/w3c/pub-manifest/blob/9a17073f65c5bae1e120933a9676250016b70148/experiments/manifest-to-internal-processor/manifestProcessor.js#L624


Preview | Diff

iherman commented 4 years ago

Marked as non substantive for IPR from ash-nazg.

mattgarrish commented 4 years ago

Looks right to me.

In 9.a.1, keyValue is the value of the key, so unless it's a map with a type it doesn't make any sense. It's the type of map that is sent in with each key/value pair. Same with 9.b.1.