feat: add support for default_value with array of symbols #132
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.
This pull request adds support for array default values to the
DefaultValuestructure for Contentful content type fields. It updates validation logic, schema definitions, import/export methods, and tests to handle array default values alongside string and boolean types. This enables fields to have localized array defaults, such as{"en-US": ["green", "blue"]}.Array default value support:
DefaultValuestruct now includes anArrayfield, allowing array default values to be stored and processed. (internal/resources/contenttype/model.go, internal/resources/contenttype/model.goR43)internal/resources/contenttype/resource.go, [1];internal/customvalidator/defaultvaluestructurevalidator.go, [2] [3] [4]Import/export and utility enhancements:
DraftandHasContentmethods forDefaultValuenow correctly process array values, and the import logic inField.Importcan handle array default values from the SDK. (internal/resources/contenttype/model.go, [1] [2] [3]getTypeOfMaputility function recognizes array types, improving type detection for default values. (internal/resources/contenttype/model.go, internal/resources/contenttype/model.goR653-R657)Testing improvements:
internal/resources/contenttype/model_test.go, internal/resources/contenttype/model_test.goR49-R361)internal/resources/contenttype/resource_test.go, [1] [2] [3]internal/resources/contenttype/test_resources/create.tf, internal/resources/contenttype/test_resources/create.tfL32-R47)