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

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

Build:
Build:
LAST BUILD BRANCH: ma-contribution
DEFAULT BRANCH: master
Ran 17 Mar 2020 01:41PM UTC
Files 10
Run time 6s
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

17 Mar 2020 01:34PM UTC coverage: 93.458% (-0.2%) from 93.692%
FLASK=1.0.2

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

293 of 331 branches covered (88.52%)

800 of 856 relevant lines covered (93.46%)

0.93 hits per line

Source Files on job 1159.24 (FLASK=1.0.2)
  • Tree
  • List 0
  • Changed 4
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 1141
  • Travis Job 1159.24
  • 1af6b68b on github
  • Prev Job for FLASK=1.0.2 on fix-873 (#1158.3)
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