Git Product home page Git Product logo

flask-stupe's People

Contributors

rambobinator avatar ramnes avatar shir0kamii avatar thomasdsantos avatar trubesv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

flask-stupe's Issues

Be more verbose on import errors

Trying to run our README's example without PyMongo installed throws:

Traceback (most recent call last):
  File "run.py", line 2, in <module>
    from flask_stupe import paginate, schema_required
ImportError: cannot import name 'paginate'

This error is completely normal, because we only expose things that are usable based on the different modules available. But it's not very developer-friendly and an error message explaining that paginate is not available because pymongo isn't installed would be much better.

Avoid prettifying json

As we can see here: http://flask.pocoo.org/docs/0.12/api/

Today flask prettify the json output unless:

This function’s response will be pretty printed if it was not requested with X-Requested-With: XMLHttpRequest to simplify debugging unless the JSONIFY_PRETTYPRINT_REGULAR config parameter is set to false. Compressed (not pretty) formatting currently means no indents and no spaces after separators.

We don't want to pass that http header each time!

TypeError: load() missing 1 required positional argument: 'data'

I ran the example in README.md and caught this error while POST-ing data to /user endpoint with the payload:

{
  "username": "itsjef",
  "password": "itsme"
}

It was this line: https://github.com/numberly/flask-stupe/blob/master/flask_stupe/validation.py#L19 that caused the bug, since schema.load() was an instance method.

My workaround is to replace

@schema_required(UserSchema)

with

@schema_required(UserSchema())

Additional Info:

  • python version: 3.6.5
  • flask-stupe version: 3.6.4
  • pymongo: 3.7.1
  • marshmallow: 2.15.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.