In [1]:
# Use this cell for the exercise
Connexion can shield us from non-conformant API implementation and allow us to validate responses too. If the response is not conformant to the OAS spec, connexion returns an error.
connexion run --strict-validation --validate-responses /code/notebooks/oas3/ex-08-pagination-ok.yaml
In [5]:
from connexion.decorators.validation import (
RequestBodyValidator,
ResponseBodyValidator,
ParameterValidator)
def CustomBodyValidator(RequestBodyValidator):
raise NotImplementedError
def main():
app = FlaskApp()
app.add_api("simple.yaml",
validate_responses=True,
validator_map={
'body': CustomBodyValidator,
}
)
In [ ]: