Repository navigation
feat(registration): support addons.preset flag to switch app base template - #140
Merged
mazhe-nerd merged 2 commits intoJul 8, 2026
Merged
Conversation
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.
What
Add support for the top-level
presetboolean field in theaddonsparameter ofregister_app/aregister_app.presetomitted orTrue(default): the app is created on top of the default base template, withaddonsitems merged in — same behavior as before.preset: False: switches to the minimal base template, so the final app config only contains whataddonsexplicitly declares. In this mode anaddonspayload without any incremental item is also valid.Why
The open platform app-creation page now supports choosing the base template through the encoded
addonsquery parameter. SDK callers that need fully self-declared app configs (avoiding drift from the default template) can now opt in withaddons={"preset": False, ...}.Behavior details
presetmust be a real boolean;1/0/ strings /Noneare rejected withValueError: addons.preset must be a boolean.presetdoes not relax them.Docs
README.md/README.zh.md: added theaddons.presetrow to theregister_appparameter table plus a usage note.Tests
lark_oapi/scene/registration/test_app_preset.py: encoding round-trips (Falsealone,False+scopes, explicitTrue), non-boolean rejection (incl. the bool-is-int trap), whitelist regression, empty-payload validity matrix, QR-URL query pass-through, sync/async full-flow with mocked transport, and a guard pinning that the key is omitted when not provided.Version
1.7.0→1.7.1(patch).