Closed eamon-otuathail closed 3 years ago
Thanks! I agree schema-dts-gen should take advantage of the demo:
prefix here.
I'm looking at my test cases and this is supposed to work already. Can you provide a repro?
Ah -- FWIW, if you change your --context
to:
--context=schema:https://schema.org/,demo:https://example.com/demo
(i.e. without the final "/" for demo)
then it works as expected.
I'll make sure to include a fix for this in the near future.
Hi Eyas,
Yes, I tried this and it works very nicely, thanks - Eamon
FWIW, if you change your --context to: --context=schema:https://schema.org/,demo:https://example.com/demo (i.e. without the final "/" for demo) then it works as expected.
schema-dts-gen accepts a
--context
parameter, which sets the value of the@context
property.Imagine we have a custom schema for an external extension which we will call custom-schema.nt, which is a mix of all the schema.org types along with custom types, which we prefix with the demo namespace. We can auto-generate TypeScript code as follows:
This nicely creates
WithContext
andGraph
:However, the custom
demo
prefix is ignored during code generation - currently we get:whereas what would be nice would be: