opened 05:32PM - 26 Jun 24 UTC
improvement
codekitchen-soos
## Suggestion
There has been use cases where validation is not always wanted fo…r input but having the input schema in the docs is. It would be nice if there was a way to optionally disable validation for a given input schema and just have APIFlask pass the unaltered JSON to the endpoint while still keeping the input documented in the schema.
Something like:
```python
@some_blueprint.post("/foos/bulk")
@some_blueprint.input(SomeSchema, validate=False)
def create_foos(json_data: dict):
...
```
or
```python
@some_blueprint.post("/foos/bulk")
@some_blueprint.doc(input=SomeSchema)
def create_foos(json_data: dict):
...
```
This solves the problem as a lot of the times, bulk endpoints for things like bulk create, bulk edit can do a "best effort" processing. ie. Create/edit all valid entries and ignore invalid entries. Endpoints like `POST /foos/bulk` or `PUT /foos/bulk`.
I can't seem to find a way of doing it with subclassing or some other method of overriding.
I'm more than happy to help and contribute with an MR if this feature is deemed useful.