• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

flask-restful / flask-restful / 1159
94%
master: 94%

Build:
Build:
LAST BUILD BRANCH: ma-contribution
DEFAULT BRANCH: master
Ran 17 Mar 2020 01:36PM UTC
Jobs 8
Files 10
Run time 5min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
1159

Pull #874

travis-ci

web-flow
Use `flask.json` as default encoder

Fix for #873.

Use `flask.json` instead of `json` standard library as the default JSON encoder.

Overriding behavior remains, but this adds the ability for `flask_restful` to pick up the encoder defined for the app, or the api blueprint.

```python
from flask_restful import Api
from flask import Blueprint
from flask import json

class CustomJSONEncoder(json.JSONEncoder):
    def default(self, obj):
        return 'custom_flask_encoder'

blueprint = Blueprint('test', __name__)
blueprint.json_encoder = CustomJSONEncoder
api = flask_restful.Api(blueprint)
app = Flask(__name__)
app.register_blueprint(blueprint, url_prefix='/blueprint')
```

or

```python
app = Flask(__name__)
app.json_encoder = CustomJSONEncoder
api = flask_restful.Api(app)
```
Pull Request #874: Use `flask.json` as default encoder

280 of 318 branches covered (88.05%)

1 of 1 new or added line in 1 file covered. (100.0%)

804 of 856 relevant lines covered (93.93%)

7.48 hits per line

Jobs
ID Job ID Ran Files Coverage
3 1159.3 (FLASK=1.0.2) 17 Mar 2020 01:36PM UTC 0
93.69
Travis Job 1159.3
6 1159.6 (FLASK=1.0.2) 17 Mar 2020 01:37PM UTC 0
93.46
Travis Job 1159.6
9 1159.9 (FLASK=1.0.2) 17 Mar 2020 01:37PM UTC 0
93.46
Travis Job 1159.9
12 1159.12 (FLASK=1.0.2) 17 Mar 2020 01:38PM UTC 0
93.46
Travis Job 1159.12
15 1159.15 (FLASK=1.0.2) 17 Mar 2020 01:38PM UTC 0
93.46
Travis Job 1159.15
18 1159.18 (FLASK=1.0.2) 17 Mar 2020 01:39PM UTC 0
93.48
Travis Job 1159.18
21 1159.21 (FLASK=1.0.2) 17 Mar 2020 01:40PM UTC 0
93.69
Travis Job 1159.21
24 1159.24 (FLASK=1.0.2) 17 Mar 2020 01:41PM UTC 0
93.46
Travis Job 1159.24
Source Files on build 1159
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1159
  • Pull Request #874
  • PR Base - master (#1158)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc