support @specifiedBy directive in SDL export

This commit is contained in:
cw-ozaki 2022-08-24 22:57:28 +09:00
parent fca337d8a0
commit 5b7790b256
1 changed files with 10 additions and 0 deletions

View File

@ -205,6 +205,7 @@ impl Registry {
description,
inaccessible,
tags,
specified_by_url,
..
} => {
let mut export_scalar = !SYSTEM_SCALARS.contains(&name.as_str());
@ -217,6 +218,15 @@ impl Registry {
}
write!(sdl, "scalar {}", name).ok();
if let Some(specified_by_url) = specified_by_url {
write!(
sdl,
" @specifiedBy(url: \"{}\")",
specified_by_url.replace('"', "\\\"")
)
.ok();
}
if options.federation {
if *inaccessible {
write!(sdl, " @inaccessible").ok();