Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't sort JSON keys in the Web API #787

Merged
merged 2 commits into from
Dec 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog

# 25.0 [#781](https://github.com/openfisca/openfisca-core/pull/781)
## 25.1.0 [#787](https://github.com/openfisca/openfisca-core/pull/787)

- Don't sort JSON keys in the Web API
- By default, `flask` sorts JSON _object_ keys alphabetically
- This is useful for reusing http caches for example, at the cost of some performance overhead
- But the [JSON specification](https://www.json.org/) doesn’t require to keep an order, as _objects_ are defined as "an unordered set of name/value pairs"

# 25.0.0 [#781](https://github.com/openfisca/openfisca-core/pull/781)

#### Breaking changes

Expand Down
1 change: 1 addition & 0 deletions openfisca_web_api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def create_app(tax_benefit_system,

app.config['JSON_AS_ASCII'] = False # When False, lets jsonify encode to utf-8
app.url_map.strict_slashes = False # Accept url like /parameters/
app.config['JSON_SORT_KEYS'] = False # Don't sort JSON keys in the Web API

data = build_data(tax_benefit_system)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

setup(
name = 'OpenFisca-Core',
version = '25.0',
version = '25.1.0',
author = 'OpenFisca Team',
author_email = 'contact@openfisca.org',
classifiers = [
Expand Down