jsonschema
jsonschema copied to clipboard
Store Id field
Make the id field from schema doc visible to user. This PD adds the Id field to schema struct and populates it using draft.getID method. Otherwise, the contents of the id field is not visible.
- rename
IdtoID
You are saving id from schema document as it is. in schema id can be relative also. I am thinking it would be better to store absolute id in struct.
Renaming Id to ID should be easy. Do you have any thoughts on the best way to resolve the global URL and append the id?
currently id is computed and stored in resource.url see draft.go:80. but here also we don't store the anchor in resource.url. anchors are calculated on demand see Draft.anchors method
you can combine resource.url+'#'+anchor to compute id. it is little bit involved.
I do not see anyone has an use case where they need ID. I don't find any compelling reason to add additional time to compilation just to compute this field