Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for a vars section in YAML schema files to provide a designated space for YAML anchor definitions and variable reuse. The change enables users to define reusable values, attributes, and configurations using YAML anchors and aliases, following YAML 1.1 specification.
Key changes:
- Added
varssection to JSON schema with optional object type - Updated scenario parsing to recognize and allow the
varstop-level key - Added comprehensive test coverage for YAML anchor functionality
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/scenario.json | Adds vars property to JSON schema as optional object for anchor definitions |
| ngraph/scenario.py | Updates recognized keys list and docstring to include vars section |
| tests/test_schema_validation.py | Adds test to verify schema validation of vars section |
| tests/test_scenario.py | Adds comprehensive tests for YAML anchor and alias functionality |
| docs/reference/dsl.md | Documents vars section usage, anchor types, and processing behavior |
| docs/reference/api-full.md | Updates documentation generation timestamp |
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.
vars- YAML Anchors and VariablesThe
varssection provides a designated space for YAML anchor definitions. YAML anchors (&name) and aliases (*name) follow the YAML 1.1 specification and are processed by PyYAML during parsing, before NetGraph validation.Anchor Types:
<<): Merge mapping properties with override capabilityMinimal Example:
Processing Behavior:
varssection itself is ignored by NetGraph runtime logicvars