Open Anti-Distinctlyminty opened 1 year ago
I am attempting to have an option JSON body, but the user of partial does not work when location="json"
partial
location="json"
bp = Blueprint(...) @bp.route("") class ModelsResource(MethodView): @bp.response(HTTPStatus.OK, ModelSchema) @bp.arguments( ModelSchema(exclude=("model_id", "parameter_schema"), partial=True), # Partial works location="query", as_kwargs=True, ) @bp.arguments( ModelSchema(only=("parameter_schema",), partial=True), # Partial does *not* work location="json", as_kwargs=True, ) def put(self, **kwargs): result = db.session.scalar( sqlalchemy.insert(Model).values(**kwargs).returning(Model) ) db.session.commit() return result
Am I doing something incorrect in the above example?
I don't think you're doing anything wrong.
This does sound like a bug. But I'd be surprised if this had been overlooked in webargs.
I am attempting to have an option JSON body, but the user of
partial
does not work whenlocation="json"
Am I doing something incorrect in the above example?