feat(OpenAPI): ✨ add feature to customize the response build…#28
Merged
Conversation
…dpoint Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an OpenAPI vendor extension to let generated Python/Flask controllers delegate final response construction to a user-provided callable, with accompanying docs/tests and a patch version bump.
Changes:
- Update the python-flask controller template to support
x-alpha-custom-response-builderfor building response objects. - Add test scaffolding + OpenAPI test spec updates demonstrating a custom response builder.
- Documentation + release metadata updates (guides, docs landing page status warning, changelog, version bumps).
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/alpha/handlers/templates/python-flask/controller.mustache |
Adds response_object_function indirection to allow a custom response builder callable. |
docs/guides/api-generation.md |
Documents the new x-alpha-custom-response-builder extension and example usage. |
tests/openapi/specification/openapi.yaml |
Enables the custom response builder for the root test endpoint via vendor extensions. |
src/alpha/utils/openapi_test/response.py |
Adds a test custom response builder implementation. |
tests/openapi/test_responses.py |
Updates assertions to validate the custom response builder output for /. |
src/alpha/utils/response_object.py |
Clarifies docstring return types for dict vs Flask response output. |
docs/index.md |
Adds a development status admonition to the docs landing page. |
src/alpha/utils/openapi_test/service.py |
Removes unused/commented-out helper code. |
CHANGELOG.md |
Adds release notes for 0.6.1. |
pyproject.toml |
Bumps project version to 0.6.1. |
uv.lock |
Updates locked package version to 0.6.1. |
README.md |
Minor whitespace cleanup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
KylianvG
approved these changes
May 1, 2026
Collaborator
KylianvG
left a comment
There was a problem hiding this comment.
Ziet er goed uit, lokaal ook al uitgeprobeerd en werkt zoals ik zou verwachten.
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.
This pull request introduces a new feature to support custom response object building in the OpenAPI Python-Flask controller template, along with documentation updates, a bug fix for authentication token refresh, and related test and versioning changes.
Custom Response Builder Feature:
Added support for a
custom_response_builderfunction in the Python-Flask controller template, allowing users to specify a custom callable for building response objects via thex-alpha-custom-response-buildervendor extension in the OpenAPI spec. The function can be imported usingx-alpha-import. This enables returning custom response formats or setting custom headers. [1] [2] [3] [4] [5] [6] [7] [8] [9]Documented the new extension
x-alpha-custom-response-builderand provided a usage example in the API generation guide. [1] [2]Bug Fixes:
Identityobject was not merged with user and group information from the database, which affected group-based permissions whenrefresh_identity_on_refreshwas enabled.Testing and Examples:
custom_response_builderfunction for testing purposes and updated the OpenAPI test specification and tests to demonstrate and verify the custom response builder functionality. [1] [2] [3]Documentation and Metadata:
pyproject.toml. Added a development status warning to the documentation and clarified response object return types in the docstring. [1] [2] [3] [4] [5]Other: