Add FML syntax validation endpoint with comprehensive error reporting#18
Closed
Add FML syntax validation endpoint with comprehensive error reporting#18
Conversation
…ation Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
…orting Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
…entation Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] add syntax validation endoint
Add FML syntax validation endpoint with comprehensive error reporting
Sep 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements a new syntax validation endpoint for FHIR Mapping Language (FML) content that provides detailed error reporting without the overhead of full StructureMap compilation.
Problem
The existing FML Runner could only validate FML syntax as part of the full compilation process. This meant developers had to wait for the entire compilation to complete just to discover basic syntax errors, and error messages were often generic without precise location information.
Solution
Added a dedicated syntax validation endpoint that:
Implementation Details
New REST API Endpoint
Valid syntax response:
{ "resourceType": "OperationOutcome", "issue": [{ "severity": "information", "code": "informational", "diagnostics": "FML syntax is valid" }] }Invalid syntax response with precise error location:
{ "resourceType": "OperationOutcome", "issue": [{ "severity": "error", "code": "syntax", "diagnostics": "Expected ')' after group inputs", "location": ["line 3, column 40"], "extension": [{ "url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-code", "valueString": "MISSING_GROUP_RPAREN" }] }] }Core Library Enhancements
validateSyntax()method with detailed error recoveryFmlSyntaxValidationResult,FmlSyntaxError,FmlSyntaxWarningMCP Tool Support
Added
validate_fml_syntaxtool to the Model Context Protocol interface for AI-assisted development workflows.Error Detection Capabilities
The validator detects and reports:
Testing
Benefits
This enhancement significantly improves the developer experience when working with FHIR Mapping Language by providing fast, accurate syntax validation with actionable error messages.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
scarf.shnode ./report.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.