-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use Schema's render_module? #747
Comments
sorry for the delay here. I don't see an issue with your code as is. @Anti-Distinctlyminty Can you be more specific about what the expected output vs actual output is? |
i believe this is actually a flask-smorest issue. flask-smorest/src/flask_smorest/response.py Line 103 in 3ec1ea6
so flask-smorest/src/flask_smorest/response.py Lines 110 to 115 in 3ec1ea6
i think you can achieve your desired output using a post-dump method import json
import jsonref
from marshmallow import INCLUDE, Schema, post_dump
class BodySchema(Schema):
class Meta:
render_module = jsonref
unknown = INCLUDE
@post_dump
def jsonref(self, data, many, **kwargs):
return json.load(jsonref.dumps(data)) |
I am trying to use
jsonref
in place of thejson
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 schemaUnfortunately it just does not work, as
$ref
s are not resolved.Am I doing something wrong here?
The text was updated successfully, but these errors were encountered: