Skip to content

refactor(json): rename \json_dump\ to \json_dumps\ (#1399) - #1400

Merged
sobolevn merged 4 commits into
wemake-services:masterfrom
amasen02:fix/rename-json-dump-to-json-dumps-1399
Sep 4, 2026
Merged

sobolevn merged 4 commits into
wemake-services:masterfrom
amasen02:fix/rename-json-dump-to-json-dumps-1399

Conversation

@amasen02

@amasen02 amasen02 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

I have made things!

AI Policy

  • I have read and agree to the AI Policy, removed any "Co-Authored-By" lines attributing coding agents, and manually reviewed the final result

Checklist

  • I have double checked that there are no unrelated changes in this pull request (old patches, accidental config files, etc)
  • I have created at least one test case for the changes I have made
  • I have updated the documentation for the changes I have made

Related issues

Closes #1399

Changes

  • Rename json_dump to json_dumps in dmr.internal.json and dmr.openapi.dump to adhere to standard Python json.dumps string-serialization conventions
  • Update OpenAPIJsonView and test client to call json_dumps
  • Retain deprecated alias json_dump = json_dumps for backwards compatibility
  • Add unit tests in tests/test_unit/test_openapi/test_dump.py
  • Document breaking change in CHANGELOG.md under 0.15.0 WIP

amasen02 and others added 2 commits September 4, 2026 13:19
)

- Rename `json_dump` to `json_dumps` across `dmr.openapi.dump` and `dmr.internal.json`
- Update `OpenAPIJsonView` and test client to use `json_dumps`
- Retain `json_dump = json_dumps` alias for backwards compatibility
- Add unit tests in `tests/test_unit/test_openapi/test_dump.py`
- Document breaking change in `CHANGELOG.md`
Comment thread dmr/internal/json.py Outdated


# Deprecated alias for backwards compatibility:
json_dump = json_dumps

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, we don't need an alias. this is an internal structure. we prefer to break things while in alpha.

Comment thread dmr/openapi/dump.py Outdated


# Deprecated alias for backwards compatibility:
json_dump = json_dumps

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here as well.

@@ -0,0 +1,27 @@
import json

from dmr.internal.json import json_dump as internal_json_dump

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need new tests :)

@codspeed

codspeed Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 12 untouched benchmarks


Comparing amasen02:fix/rename-json-dump-to-json-dumps-1399 (1d23bbb) with master (06626f9)

Open in CodSpeed

@amasen02

amasen02 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Makes complete sense since we're in alpha. Dropped the json_dump aliases from dmr/internal/json.py and dmr/openapi/dump.py, and removed the redundant alias test file. Ran the full unit test suite (all 2,171 tests pass) and linters are all green.

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (06626f9) to head (1d23bbb).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1400   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          467       467           
  Lines        21639     21639           
  Branches       660       660           
=========================================
  Hits         21639     21639           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sobolevn
sobolevn merged commit effde97 into wemake-services:master Sep 4, 2026
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename json_dump to json_dumps

2 participants