Closed OscarWang114 closed 1 year ago
Closing this PR as I figured out a better solution. This PR forcefully adds the x_api_version
parameter to every request handler function in default_controllers_impl.py
, which is not only an overkill and hard to maintain but also defeats the original purpose of checking the API version using @app.before_request in init.py
.
This PR adds an optional API version header to every request in
openapi.yaml
. This is required because the CLI's api client rejects any unknown parameters during validation, meaning we cannot pass in the API version header without defining it inopenapi.yaml
.I tried to make it as easy to maintain as possible by defining a global
APIVersionHeader
object and referencing it at the top level of each API path.