[Fix] Dimension type validation false positive#87
Open
sakari-malkki wants to merge 5 commits intodevfrom
Open
Conversation
…as for dimension types
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a content-validation false positive when VARIABLE-TYPE uses known aliases (Contents for Content, Region for Geographical) by downgrading the validation feedback from error to warning, and updates parsing/token configuration plus unit tests to cover the scenario.
Changes:
- Add
ContentsandRegionvariable-type tokens toPxFileConfiguration. - Map
Contents→DimensionType.ContentandRegion→DimensionType.GeographicalinValueParserUtilities.StringToDimensionType. - In content validation, treat these aliases as warnings (not errors) and add unit tests/fixtures for the behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Px.Utils/Validation/ContentValidation/ContentValidator.ValidationEntryFunctions.cs | Downgrades VARIABLE-TYPE alias invalid-value feedback from Error to Warning. |
| Px.Utils/PxFile/PxFileConfiguration.cs | Adds new configurable tokens for Contents and Region. |
| Px.Utils/ModelBuilders/ValueParserUtilities.cs | Adds alias mappings in StringToDimensionType. |
| Px.Utils.UnitTests/Validation/Fixtures/ContentValidationFixtures.cs | Adds structured-entry fixtures for alias VARIABLE-TYPE values. |
| Px.Utils.UnitTests/Validation/ContentValidationTests/ContentValidationTests.cs | Adds a unit test asserting Warning level for known aliases. |
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.
Fixes a false positive validation issue when dimension types are defined by known aliases (Content/Contents and Geographical/Region). Added tests to cover the case.