Skip to content

Adsk Contrib - Allow read and write of file rules without color space validation#1976

Merged
doug-walker merged 2 commits into
AcademySoftwareFoundation:mainfrom
autodesk-forks:bug/partial_file_rules
Aug 9, 2024
Merged

Adsk Contrib - Allow read and write of file rules without color space validation#1976
doug-walker merged 2 commits into
AcademySoftwareFoundation:mainfrom
autodesk-forks:bug/partial_file_rules

Conversation

@doug-walker
Copy link
Copy Markdown
Collaborator

It is generally possible to read and write configs that are syntactically valid but which are incomplete and hence would not pass validation. (For example, it is currently possible to serialize or load a config without any displays and views and would hence fail validation.) This is useful in scenarios where one wants to serialize configs that are only partially complete.

Currently, OCIOYaml.cpp is doing some inappropriate validation during config serialization and parsing regarding the default role and the FileRules Default rule. This PR removes those checks from OCIOYaml.cpp but adds unit tests to confirm that config->validate would still catch these problems.

This gives the calling program the flexibility to serialize a partial config, for example that has a role that refers to a color space that may not have been added yet. Of course, before any config is used the caller should call validate, which is normally where problems of this type are supposed to be surfaced.

Signed-off-by: Doug Walker <doug.walker@autodesk.com>
@doug-walker doug-walker requested a review from cozdas May 31, 2024 00:57
Copy link
Copy Markdown
Collaborator

@cozdas cozdas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@doug-walker doug-walker merged commit 87ccf32 into AcademySoftwareFoundation:main Aug 9, 2024
@doug-walker doug-walker deleted the bug/partial_file_rules branch August 9, 2024 22:29
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.

3 participants