-
Notifications
You must be signed in to change notification settings - Fork 211
Description
If we expand a URI with "@base" not ending with a "/", we get a URI missing the last path fragment.
For example
"@base":"http://example.com/loutre" with"@id":"toto" gives http://example.com/toto when we would expect http://example.com/loutre/toto. If "@base" ends with a "/" it works fine.
Playground expansion without "/"
This issue is only on URI expansion, but the behaviour is different on URI compaction : a "@base" with or without "/" will give the same URI fragment.
This will be a problem when round-tripping because the input URI will change after re-expansion.
Input: "@id":"http://example.com/loutre/toto"
Compaction with "@base":"http://example.com/loutre" gives
"@context": {
"@base": "http://example.com/loutre"
},
"@id": "toto"
Which re-expanded gives "http://example.com/toto".
Playground compaction, "@base" without "/"
Proposed fix: ethieblin#2