Add DSL entity validation and transformation#218
Merged
zachdaniel merged 1 commit intoash-project:mainfrom Sep 25, 2025
Merged
Conversation
Implements early validation of DSL entity structures to catch configuration errors at compile time rather than runtime. Key improvements: - Add validate_and_transform/3 function for recursive entity validation - Ensure nested entities are properly formatted as lists - Add validation hooks in extension building, section processing, and patches - Provide detailed error messages with module and path context - Add test coverage for validation scenarios This prevents invalid DSL configurations from causing runtime errors and provides better developer experience with clear error messages.
zachdaniel
approved these changes
Sep 25, 2025
Contributor
|
🚀 Thank you for your contribution! 🚀 |
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.
Overview
Fixes #215
Instead of adding an additional
List.wrap, I thought it might be a good idea to perform validation and transformation early on. This PR removes one List.wrap :PI believe this might cause a slow down of consumers, as we potentially recurse the entity tree repeatedly and don't cache the transformation results.
As a demo, this implements #215. But more validations could be added to catch common misconfigurations. (E.g. to also allow sub-entities without keys, by transforming
entities: [@child]toentities: [child_entity_name: [@child]].Please let me know if this is feasible/wanted - otherwise I'll just add the List.wrap :)
LLM generated commit message
Implements early validation of DSL entity structures to catch configuration errors at compile time rather than runtime. Key improvements:
This prevents invalid DSL configurations from causing runtime errors and provides better developer experience with clear error messages.
Contributor checklist
Leave anything that you believe does not apply unchecked.