Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow OpenAPI spec overrides #5176

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Implements user-level OpenAPI overrides in the @api decorator.

This PR adds support for customizing OpenAPI specification fields in BentoML services by:

  1. Adding openapi_overrides parameter to @api decorator
  2. Adding openapi_overrides field to APIMethod class
  3. Implementing merge logic to combine user overrides with auto-generated spec

Example usage:

@bentoml.api(
    openapi_overrides={
        "description": "Custom API description",
        "tags": ["custom-tag"],
        # Any valid OpenAPI field can be overridden
    }
)
def predict(self, input_data):
    ...

Link to Devin run: https://app.devin.ai/sessions/43f58b594b65481d81ffb5564bc6eb94

Allow users to customize OpenAPI specification fields by providing
openapi_overrides in the @api decorator. The overrides are merged
with the auto-generated specification.

Co-Authored-By: Chaoyu Yang <[email protected]>
@devin-ai-integration devin-ai-integration bot requested a review from a team as a code owner January 9, 2025 23:54
@devin-ai-integration devin-ai-integration bot requested review from larme and removed request for a team January 9, 2025 23:54
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add "(aside)" to your comment to have me ignore it.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link

Code Coverage

Package Statements
bentoml 55.17% (9912 / 17965)
Summary 55.17% (9912 / 17965)

@devin-ai-integration devin-ai-integration bot force-pushed the devin/1736466637-openapi-overrides branch from cd3f753 to 75062ad Compare January 10, 2025 01:36
Comment on lines +71 to +72
OpenAPI Specification Customization
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
OpenAPI Specification Customization
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OpenAPI Specification Customization
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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.

1 participant