docs(v30): clarify required non-indexed fields are now type-validated#470
Open
alangmartini wants to merge 1 commit intotypesense:masterfrom
Open
Conversation
In v30.0+ the skip-validation gate for `index: false` tightened to also require `optional: true`. Required non-indexed fields are now type validated on write, which can cause imports that previously succeeded under v29.x to return 400 errors after upgrading. Updates the v30.0/30.1/30.2 release notes (Deprecations / behavior changes) and the "Indexing all but some fields" section in collections.md to spell out the new constraint and the recommended fixes (set the field optional, or change the type to match the data shape).
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.
Summary
In v30.0+ the skip-validation gate for
index: falsetightened to also requireoptional: true. Required non-indexed fields are now type-validated on write, which can cause imports that previously succeeded under v29.x to return400 Field 'X' has an incorrect typeerrors after upgrading.The existing v30 release notes call this out as an enhancement (
Allow non-indexed nested fields to still be marked as required.), but they don't explain the implication for users with legacy schemas. This PR adds the necessary context.Changes
docs-site/content/30.{0,1,2}/api/README.md: Expand the existing enhancement bullet to point to the behavior changes section, and add a new entry inDeprecations / behavior changesexplaining the validation tightening, the symptom users will hit on upgrade, and the two recommended fixes (setoptional: true, or change the field type to match the data shape).docs-site/content/30.{0,1,2}/api/collections.md: Replace the outdated noteit is not currently possible to have a mandatory field excluded from the indexingin theIndexing all but some fieldssection with a:::warningblock that accurately describes the v30+ behavior.Background
Came up via a customer support thread: a v29.0.rc25 → v30.2 upgrade started failing imports for a field declared as
{"type": "object", "index": false, "optional": false}with array-shaped data. The runtime change is atsrc/field.cpp::flatten_doc:744, which now skips validation only when both!indexandoptional. Confirmed with a side-by-side reproducer across v27.0 / v28.0 / v29.0.rc25 / v30.2.Test plan
#indexing-all-but-some-fieldsresolves on the published docs site for each version.