fuhrysteve / marshmallow-jsonschema

JSON Schema Draft v7 (http://json-schema.org/) formatting with marshmallow
MIT License
209 stars 72 forks source link

Nothing gets rendered by brutusin #146

Open tsoernes opened 3 years ago

tsoernes commented 3 years ago

I have followed the example in the docs, but I don't get output when visiting http://localhost:5000: https://i.imgur.com/vqIEkw1.png. Console outputs nothing. https://i.imgur.com/Yiw7XmU.png

While this works: http://localhost:5000/schema

{"$ref":"#/definitions/Query","$schema":"http://json-schema.org/draft-07/schema#","definitions":{"Query":{"additionalProperties":false,"properties":{"from_country":{"default":"UK","title":"from_country","type":["string","null"]},"from_country_iso2":{"default":null,"maxLength":2,"minLength":2,"title":"from_country_iso2","type":["string","null"]},"from_country_iso3":{"default":null,"maxLength":3,"minLength":3,"title":"from_country_iso3","type":["string","null"]},"in_amount":{"default":"200","title":"in_amount","type":"string"},"to_country":{"default":"US","title":"to_country","type":["string","null"]},"to_country_iso2":{"default":null,"maxLength":2,"minLength":2,"title":"to_country_iso2","type":["string","null"]},"to_country_iso3":{"default":null,"maxLength":3,"minLength":3,"title":"to_country_iso3","type":["string","null"]}},"type":"object"}}}

Code as in docs:

@app.route("/schema")
def get_schema():
    js_di = JSONSchema().dump(Query.Schema())
    return jsonify(js_di)

@app.route("/")
def home():
    return """<!DOCTYPE html> ..............