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

Feature request: Mark API operation as deprecated for OpenAPI documentation #5674

Open
1 of 2 tasks
tcysin opened this issue Dec 1, 2024 · 3 comments
Open
1 of 2 tasks
Assignees
Labels
feature-request feature request triage Pending triage from maintainers

Comments

@tcysin
Copy link

tcysin commented Dec 1, 2024

Use case

When customizing API operations, I'd like to be able to mark an operation as deprecated (see Operation Object, OAS v3.0.3).

This helps to tell the users that an operation will be, well, deprecated. Here's what it looks like with Petstore example in Swagger Editor:

Solution/User Experience

An extra deprecated boolean parameter with a False default:

from aws_lambda_powertools.event_handler import APIGatewayRestResolver
from aws_lambda_powertools.event_handler.api_gateway import Router

app = APIGatewayRestResolver()

@app.get("/spam", deprecated=True)
def spam(name):
    return {"message": "mmm... tasty"}

@app.get("/eggs")  # deprecated=False by default
def eggs(name):
    return {"message": "cheese"}

router = Router()

@router.get("/ham", deprecated=True)
def ham():
    return {"message": "ham!"}

Acknowledgment

Thanks for your hard work!

@tcysin tcysin added feature-request feature request triage Pending triage from maintainers labels Dec 1, 2024
Copy link

boring-cyborg bot commented Dec 1, 2024

Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@anafalcao
Copy link
Collaborator

Hi @tcysin ! Thanks for opening this feature request, and sorry for the delay, we were at re:invent last week.
Would you like to open a PR with your solution or do you prefer us to work on it and come back to you?

@anafalcao anafalcao self-assigned this Dec 10, 2024
@tcysin
Copy link
Author

tcysin commented Dec 12, 2024

It's all good 👍
Yeah, I'm giving it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request feature request triage Pending triage from maintainers
Projects
Development

No branches or pull requests

2 participants