use blazingly_aasa::{validate, DiagnosticCode};
const DOCUMENT: &[u8] = br#"{
"applinks": {
"details": [
{ "appIDs": ["ABCDE12345.com.example.app"],
"components": [
{ "?": { "id": "42", "flag": true } },
{ "/": "/sale/*" },
{ "comment": "everything else" }
]
},
{ "components": [{ "/": "/orphan" }] }
]
}
}"#;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let report = validate(DOCUMENT)?;
for diagnostic in report.diagnostics() {
println!("{diagnostic}");
}
println!();
println!(
"errors: {} warnings: {}",
report.errors().len(),
report.warnings().len()
);
println!("has_errors: {}", report.has_errors());
if report.contains(DiagnosticCode::UnsupportedQueryPredicate) {
println!("AASA150 present: a query dictionary in this file is inert");
}
Ok(())
}