schemars
schemars copied to clipboard
Make schemars_derive add the Rust namespace to the schema_names.
Right now, #[derive(JsonSchema)] does not include any namespace, even when deriving from Rust source files in different modules.
This can cause naming conflicts that are hard to debug (because one of the structs is made to stand in for the other same-named completely different struct in another module) and generally seem like a bad idea.
This PR is the easiest fix: It just prefixes the schema_name with the module_path. That way, the schema names are unique.
See also https://github.com/GREsau/schemars/issues/62