apache / apache/daffodil-vscode

Support Daffodil infoset validation equivalent to the CLI -V/--validate option

Open
#1,762 0 comments 0 reactions 0 assignees View on GitHub
debugger enhancement
Dominant language
TypeScript
Stars
18
Forks
33
Avg merge
3d 6h
Merged PRs (30d)
7

Description

## Problem Description

Apache Daffodil’s parse command supports the -V / --validate option for validating the infoset generated during parsing:
`-V, --validate `
The VS Code extension should provide equivalent configuration for parse and debug operations.

This is different from #1273 , which validates the DFDL schema during schema compilation. This issue concerns validation of the resulting infoset after data has been parsed.

The current Apache Daffodil CLI supports the following validators:
```
off — disable infoset validation
daffodil — use Daffodil’s built-in XML Schema validation
xerces[=value] — use Xerces XML Schema validation
schematron[=value] — use Schematron validation
Custom validators registered with Daffodil
```

The optional value identifies a validator configuration file, such as an .xsd, .sch, .conf, or .properties file.

For example:
```
daffodil parse -s schema.dfdl.xsd -V daffodil input.dat
daffodil parse -s schema.dfdl.xsd -V xerces input.dat
daffodil parse -s schema.dfdl.xsd -V schematron=rules.sch input.dat
```
## Proposed Solution

Add an infoset validation option to the extension’s launch configuration and Launch Wizard.

Possible launch configuration (consider to keep it with infoset config options):
```
{
"validation": {
"validator": "xerces",
"configuration": "${workspaceFolder}/schema.dfdl.xsd"
}
}
```

The `configuration `property should be optional and used only when required by the selected validator (Xerces or schematron).

The extension does not necessarily need to invoke the Daffodil CLI directly. It may implement the equivalent functionality through the DAPodil interfaces.

## Acceptance Criteria

- Launch configurations support an infoset validation setting.
- The Launch Wizard allows users to select off, daffodil, xerces, or schematron.
- Validation defaults to off.
- Allow an optional configuration file for validators that support one.
- The selected validator is applied during parsing.
- Validation diagnostics are displayed in VS Code.
- Validation diagnostics are distinguishable from schema compilation and parse errors.
- Existing launch configurations remain backward compatible.
- Continue producing or displaying the infoset when Daffodil makes it available following a validation failure.
- Documentation explains the difference between this feature and schema validation in #1273.

## Impact and Benefits

This feature allows users to validate the generated infoset directly in VS Code, identifying data that parses successfully but violates XSD or Schematron constraints. It improves Daffodil CLI parity and provides earlier feedback without leaving the IDE.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the extension's launch configuration and Launch Wizard entry points, then trace how parse and debug operations invoke Daffodil or DAPodil. Review #1273 to keep infoset validation distinct from schema validation. Done means the selected validator and optional configuration are applied during parsing, diagnostics are distinguishable, and the infoset remains available after validation failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.