Skip to content

Comments

Add FML syntax validation endpoint for real-time error checking#9

Closed
Copilot wants to merge 4 commits intocopilot/fix-68751953-ec1b-4f7f-baaf-bea86fb34a74from
copilot/fix-7cab2c7e-bb29-4789-9f60-10eb038719c5
Closed

Add FML syntax validation endpoint for real-time error checking#9
Copilot wants to merge 4 commits intocopilot/fix-68751953-ec1b-4f7f-baaf-bea86fb34a74from
copilot/fix-7cab2c7e-bb29-4789-9f60-10eb038719c5

Conversation

Copy link
Contributor

Copilot AI commented Sep 29, 2025

  • Analyze user feedback requesting rebase on correct branch
  • Switch to requested base branch copilot/fix-68751953-ec1b-4f7f-baaf-bea86fb34a74
  • Re-implement FML syntax validation functionality on correct base
  • Add syntax validation types and interfaces
  • Implement validateSyntax method in FmlCompiler class
  • Add validateFmlSyntax wrapper method in FmlRunner class
  • Add REST API endpoint POST /api/v1/validate-syntax
  • Add MCP tool validate-fml-syntax with proper handler
  • Create comprehensive test suites for all components
  • Verify all tests pass successfully

Implementation Complete

Successfully rebased the FML syntax validation endpoint implementation onto the correct base branch as requested by @litlfred. The implementation includes:

Core Features

Syntax-only validation without full compilation for faster feedback
Detailed error reporting with line/column information and error codes
Comprehensive validation including empty content, missing map keyword, unmatched braces/parentheses/brackets
Type safety with TypeScript interfaces for all validation results
Performance optimized by reusing existing tokenization logic

Implementation Details

Core Library (packages/fmlrunner):

  • Added FmlSyntaxValidationResult, FmlSyntaxError, FmlSyntaxWarning types
  • Implemented validateSyntax() method in FmlCompiler with 150+ lines of validation logic
  • Added validateFmlSyntax() wrapper method in main FmlRunner class
  • Full test coverage with 15 test cases across 2 test files

REST API (packages/fmlrunner-rest):

  • Added POST /api/v1/validate-syntax endpoint
  • Validates fmlContent parameter and returns structured JSON response
  • Returns {isValid, errors[], warnings[]} format

MCP Interface (packages/fmlrunner-mcp):

  • Added validate-fml-syntax tool with same input schema as compile-fml
  • JSON schema validation for input parameters
  • Structured JSON response compatible with MCP protocol

Testing & Verification

  • 15 comprehensive test cases covering valid/invalid FML scenarios
  • Integration tests using actual FmlRunner class
  • All tests passing with proper error detection and validation

The implementation is now based on the correct branch as requested and maintains all functionality from the original implementation.

Original prompt

This section details on the original issue you should resolve

<issue_title>add syntax validation endoint</issue_title>
<issue_description>add endpoint in services library (and then REST and MCP corresponding) to validate the syntax of a fhir mapping language content. should give useul error messages when failed.

this should be based off of #6</issue_description>

<agent_instructions>use a nice branch name like copilot-add-syntax-validation-endpoint</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #3

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 3 commits September 29, 2025 18:26
Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
…nd MCP interface

Co-authored-by: litlfred <662242+litlfred@users.noreply.github.com>
…ndpoint

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 for real-time error checking Sep 29, 2025
Copilot AI requested a review from litlfred September 29, 2025 18:37
@litlfred
Copy link
Owner

no. I wanted it built off of branch copilot/fix-68751953-ec1b-4f7f-baaf-bea86fb34a74 @copilot

Copy link
Contributor Author

Copilot AI commented Sep 29, 2025

no. I wanted it built off of branch copilot/fix-68751953-ec1b-4f7f-baaf-bea86fb34a74 @copilot

I've rebased the syntax validation endpoint implementation onto the correct base branch copilot/fix-68751953-ec1b-4f7f-baaf-bea86fb34a74 as requested. The implementation includes all the same functionality:

✅ Core syntax validation in FmlCompiler and FmlRunner classes
✅ REST API endpoint: POST /api/v1/validate-syntax
✅ MCP tool: validate-fml-syntax
✅ Comprehensive test coverage (15 tests all passing)
✅ Detailed error reporting with line/column info and error codes

The changes are now properly based on the branch you specified rather than the previous one. All tests are passing and the functionality is working correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants