Repository navigation
Return the rejected attributes of block writes - #25
Conversation
The API now removes the attributes and the mobile keys that a block type does not declare, and adds "rejected" to the response of a block insert, a block update and a block validation. SingleEmailBlock had no field for it, so Gson dropped it. SingleEmailBlock now has a nullable rejected field of the existing EmailRejected type. The Javadoc of EmailValidation no longer says that only the settings validation has rejected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The API now accepts as template_id a simple editor template from the shared gallery or a template that the account saved from its own email. The Javadoc of EmailBase.templateId and the README said "only a template from the shared gallery". The Javadoc of createTemplate and the README now say that the ID of the new template works as template_id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Low risk] The risk rests on an additive, nullable SummaryAdds rejected attributes to block write responses and updates template docs SingleEmailBlock gains a nullable What's good
Review context · 0/5 commands · 1 overlapping pull request
Reviews (1) · Last reviewed commit: "docs: say that template_id also accepts..." · claude-sonnet-5-5 |
4fcc9e5
into
feature/cmac-1017-add-the-simple-editor-email-endpoints-to-the-java-sdk
Why?
The API changed after #23 was written:
rejected. The API removes the attributes and themobilekeys that the block type does not declare, and the write is still a success.SingleEmailBlockhad no field for it, so Gson dropped it, and the caller could not see that the API removed values.template_idon a campaign create now also accepts a simple editor template that the account saved from its own email. The SDK docs said "only a template from the shared gallery".This PR is stacked on #23. Merge it after #23, or retarget it to
mainwhen #23 is merged.Changes
rejectedon block writes (first commit)SingleEmailBlockhas a new nullable field:rejected, of the existing typeEmailRejected(messageandkeys). OnlycreateBlockandupdateBlockfill it.getBlockandmoveBlockleave itnull.createBlockandupdateBlockand the README sections "Insert a block" and "Update a block" describe the field. The two README examples print the keys whenrejectedis notnull.EmailValidation.rejectedno longer says that only the settings validation has it. The API sends it for a block validation too, only whenvalidistrue. The Javadoc ofvalidateBlockand the README section "Validate a block" say this.EmailRejectednow covers the block keys too, for exampleeditor_content.attrs.onclick.template_iddocs (second commit, docs only)EmailBase.templateIdand the README section "Create a campaign with the simple editor" now say: a template from the shared gallery, or a template that you saved from your own email withcreateTemplate. It still needseditorset tosimple, and it must be the same on every email.createTemplateand the README section "Save an email as a template" say that the ID of the new template works astemplateId.Compatibility
All changes add to the public API. No public signature changes. Code that reads
SingleEmailBlockcontinues to work.rejectedisnullwhen the API sends norejected.Tests
createBlockandupdateBlockwithrejected: the test checksmessageandkeys. The update fixture has anattrskey and amobilekey.createBlock,updateBlock,getBlockandmoveBlockwithoutrejected:rejectedisnull.validateBlockwithrejectedon a valid block.rejected.mvn testpasses on JDK 11 and on JDK 21 (180 tests, 0 failures, 0 errors).mvn javadoc:javadocon JDK 11 gives no warnings.paragraphblock witheditor_content.attrs.onclickreturnedrejected.keyswitheditor_content.attrs.onclick, andSingleEmailBlock.rejectedhad the same keys. A move returned norejected, and the field wasnull. A campaign create with the ID fromcreateTemplateastemplateIdreturned201.How to test
mvn test.pom.xmlsetstestFailureIgnore, so read theTests runsummary, not the exit code."onclick", "x"inattrs. Make sure thatresponse.rejected.keyshaseditor_content.attrs.onclick.response.rejectedisnull.How to release
Release this together with #23. No separate release is necessary.
Rollback
No data or configuration changes. To roll back, revert the merge commit.
🤖 Generated with Claude Code