Skip to content

fix: interpretation of slice nil pointer instead of empty slice in validation draft #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

demeyerthom
Copy link
Member

This pull request addresses a bug in content type validation and enhances the robustness of the Validation struct by refining its handling of nil slices. Additionally, it introduces comprehensive unit tests to ensure correctness and prevent regressions.

Bug Fixes:

Code Improvements:

  • internal/resources/contenttype/model.go: Updated the Draft method in the Validation struct to check for nil slices instead of using len() checks, ensuring proper handling of uninitialized slices.

Testing Enhancements:

  • internal/resources/contenttype/model_test.go: Added unit tests for the Draft method to verify behavior for unsupported validations, unique validations, and EnabledNodeTypes validations, ensuring comprehensive coverage.

@demeyerthom demeyerthom requested a review from a team as a code owner June 13, 2025 08:09
@demeyerthom demeyerthom linked an issue Jun 13, 2025 that may be closed by this pull request
@demeyerthom demeyerthom changed the title fix: interpretation of slice nill pointer instead of empty slice in validation draft fix: interpretation of slice nil pointer instead of empty slice in validation draft Jun 13, 2025
@demeyerthom demeyerthom merged commit 52292cf into main Jun 13, 2025
4 checks passed
@demeyerthom demeyerthom deleted the 73-disable-all-nodes-types-for-richtext-validation-breaks branch June 13, 2025 09:59
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.

Disable all nodes types for RichText validation breaks
1 participant