Open mrtedn21 opened 1 year ago
Thanks for the PR! I thought about it for a minute, and it seems that making a method that you can override for this would add less complexity. So I made & merged this PR #180
If you are working off of the latest master, you should now be able to override the _schema_base method:
from marshmallow_jsonschema import JSONSchema
class MyJSONSchema(JSONSchema):
def _schema_base(self, name):
return {"type": "object", "$ref": "#/anything_you_want_here/{}".format(name)}
Let me know if that works for you!
O thanx, it is good solution, but method "wrap" with "post_dump" decorator, that creates resulting json_schema dict, it anyway hardcode with '#/definitions/'
of resulting json schema, where schemas are placed