TypeReferenceId RFC 3986 support improvements

This commit is contained in:
Piotr Siuszko 2025-07-07 19:45:32 +02:00
parent bc52a1ad5a
commit e07b19510c
2 changed files with 5 additions and 5 deletions

View File

@ -1781,7 +1781,7 @@ mod tests {
); );
{ {
let first = response.definitions.iter().next().expect("Should have one"); let first = response.definitions.iter().next().expect("Should have one");
assert_eq!(first.0, &TypeReferenceId::from("glam-Vec3")); assert_eq!(first.0, &TypeReferenceId::from("glam::Vec3"));
} }
let response = export_registry_types_ext( let response = export_registry_types_ext(
BrpJsonSchemaQueryFilter { BrpJsonSchemaQueryFilter {

View File

@ -274,10 +274,10 @@ impl Display for TypeReferenceId {
impl From<&str> for TypeReferenceId { impl From<&str> for TypeReferenceId {
fn from(t: &str) -> Self { fn from(t: &str) -> Self {
TypeReferenceId( TypeReferenceId(
t.replace("::", "-") t.replace("::", "__")
.replace(", ", "+") .replace(", ", ".")
.replace(")", "") .replace(")", "~")
.replace("(", "") .replace("(", "~")
.replace(">", "-") .replace(">", "-")
.replace("<", "-") .replace("<", "-")
.into(), .into(),