marshmallow-sqlalchemy icon indicating copy to clipboard operation
marshmallow-sqlalchemy copied to clipboard

How to use Schema's render_module?

Open Anti-Distinctlyminty opened this issue 2 years ago • 0 comments

I am trying to use jsonref in place of the json module in a schema so that I can use json references. I have tested the jsonref module and it works just fine, however I am using it as follows in a schema

import jsonref

class BodySchema(Schema):
    class Meta:
        render_module = jsonref
        partial = True
        unknown = INCLUDE

...

# flask-smorest stuff
bp = Blueprint(...)

@bp.route("<int:model_id>/submit")
class ModelInstanceResource(MethodView):
    @bp.arguments(
        BodySchema,
        location="json",
        as_kwargs=True,
    )
    def post(self, **kwargs):
        pass

Unfortunately it just does not work, as $refs are not resolved.

Am I doing something wrong here?

Anti-Distinctlyminty avatar Aug 03 '23 21:08 Anti-Distinctlyminty