Marwes / schemafy

Crate for generating rust types from a json schema
MIT License
242 stars 51 forks source link

Input file path is interpreted relative to Cargo workspace root #27

Closed vadimcn closed 4 years ago

vadimcn commented 4 years ago

The documentation does not state this explicitly, but it looks like the intention was for schemafy!'s path parameter to be relative to the crate root? Unfortunately, in the current incarnation, this path is actually relative to Cargo workspace root, which is pretty confusing when macro fails with "No such file or directory" error.
I think it would be better if the path were relative to the current file, like std::include_str! does.