Skip to content

AlterType, fix payload serialization#105

Merged
toptobes merged 1 commit into
mainfrom
SL-alter-type-payload-fix
Jul 14, 2026
Merged

AlterType, fix payload serialization#105
toptobes merged 1 commit into
mainfrom
SL-alter-type-payload-fix

Conversation

@sl-at-ibm

Copy link
Copy Markdown
Collaborator

This PR changes the resulting serialization for AlterTypePayload as follows: the operation layer is removed (the Data API does not expect it).

So instead of having e.g.

{
    "alterType": {
        "name": "member",
        "operation": {
            "add": {
                "fields": {
                    "email": {
                        "type": "text"
                    },
                    "credits": {
                        "type": "int"
                    }
                }
            }
        }
    }
}

we now end up with the working json:

{
    "alterType": {
        "name": "member",
        "add": {
            "fields": {
                "email": {
                    "type": "text"
                },
                "credits": {
                    "type": "int"
                }
            }
        }
    }
}

To achieve this, some of the logic around marshaling of the AlterTypePayload are applied (including the introduction of a "key name" string method to the alter type operation interface for building the appropriate payload).

(Besides the altered unit test, this branch is tested manually by altering a type in both add and rename ways, successfully).

Reference Slack conversation: here.

@toptobes toptobes added this pull request to the merge queue Jul 14, 2026
Merged via the queue into main with commit 79e22f7 Jul 14, 2026
9 checks passed
@sl-at-ibm sl-at-ibm deleted the SL-alter-type-payload-fix branch July 14, 2026 20:01
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.

2 participants