Skip to content

Add option to deprecate paths #75

@vagosduke

Description

@vagosduke

Is your feature request related to a problem? Please describe.
Once defined, all paths are added to the api version they are linked with, and all the following versions after that. It would be beneficial to be able to deprecate paths

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A deprecate_in= option in the @version decorator could cause certain viewfunctions to stop being added to the API paths after a certain version.

An example would be the following

@app.get('/greet')
@version(1)
def greet():
  return 'Hello'

@app.get('/greet')
@version(2, deprecate_in=3)
def greet():
  return 'Hi'

@app.get('/new-greet')
@version(3)
def new_greet():
  return 'This is a different greetings function linked to a different url'

This would result in the following endpoints:

/v1/greet
/v2/greet
/v3/new-greet

(Now, the normal behaviour without deprecate_in is that in v3, both the /v3/new-greet and /v3/greet paths would be available)


I have implemented the solution, but I cannot push it. Can I be given access?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions