fix(data-sources): make schema round-trips writable#99
Merged
Conversation
Data source update payloads carried computed property configurations — created and edited metadata columns the API refuses to accept back — and hydrated empty configurations serialized as arrays where the API requires objects, because the empty-configuration normalization only recognized hand-built single-key configs. Computed configurations are now filtered from updates and the normalization also resolves the config key from the type field.
brd6
force-pushed
the
fix/data-source-schema-round-trip
branch
from
July 14, 2026 22:28
656d7cc to
3f7f863
Compare
7 tasks
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.
Description
Completes the retrieve-then-update story for data sources (the schema-level counterpart of #97):
DataSource::toArrayForUpdate()drops computed property configurations —created_by,created_time,last_edited_by,last_edited_timecolumns — which the Update Data Source API refuses ("Last edited by is not a valid property schema").normalizeEmptyPropertyConfigurations()now also recognizes hydrated configuration shapes: it previously converted empty configs to{}only for hand-built single-key configs, so a retrieveddatecolumn serialized its empty config as[]and failed validation. The config key is now resolved from thetypefield when present.Motivation and context
Programmatic schema editing by retrieve-modify-update — adding or renaming a column — failed on any data source with a computed or empty-config column, which is nearly all real ones.
How has this been tested?
dateconfig serializes as{}(asserted on the raw JSON) while computed columns stay filtered.date,select, andtitle) previously failed and now succeeds with the schema intact.parallel-lint,phpcs, PHPStan, and Psalm.Builds on #98 (property names preserved in payloads); the diff shown includes it until that merges.
Types of changes
PR checklist