feat: Report schema source in validation output
Add schemaSource field to track and report the source of the schema used for validation (URL, file path, or version tag). This helps users understand which schema was actually used, especially when using custom schemas or specific versions.
- Add schemaSource to SummaryOutput interface
- Return schema source from loadSchema function
- Display schema source in both JSON and text output formats
- Show schema information section after summary in console output
🤖 Generated with Claude Code
Would look like
❯ deno run -A ~/proj/bids/bids-validator/src/bids-validator.ts --schema=https://bids-specification--1128.org.readthedocs.build/en/1128/schema.json --ignoreNiftiHeaders . --json | jq . | tail
"dataProcessed": false,
"pet": {},
"dataTypes": [
"func",
"anat"
],
"schemaVersion": "1.2.0-dev",
"schemaSource": "https://bids-specification--1128.org.readthedocs.build/en/1128/schema.json"
}
}
or in text mode like
(I am open to less or more artistic indentation there ;-) )
Otherwise it is not entirely clear, e.g. in
- https://github.com/bids-standard/bids-examples/pull/515 if we are using the schema we think we are using!
TODOs
- [ ] decide to either keep or not AI generated tests - they might be too verbose to liking but seems to point to absent prior testing of specifications via env var etc.
While we only use that function once in the app, we use it a lot in the tests.
While we only use that function once in the app, we use it a lot in the tests.
what would you recommend?
I would probably separate calculating the location and loading into two functions. When you care about saving the location, call one, then the other. When you don't, calling the second one with no arguments could call the first.
Sorry, on my phone now, so no pseudocode.
Marking as draft as it looks like you have a few more iterations to go. If you need further guidance, re-mark as ready.
That said, I don't want to force a rewrite if @rwblair disagrees, so I'll let him weigh in.
Separating version string to url and loading from url into two functions sounds good to me.