Releases: pmdevita/django-shinobi
1.4.2
Shinobi 1.4.2 fixes a few minor bugs that our tests didn't cover before the 1.4.1 release.
- In Python 3.13 or older, empty/blank Schemas (useful for sharing config between Schemas) no longer crash trying to import
annotationlib. - In Python 3.14, ModelSchema now correctly constructs types for private attributes (fields starting with
_) again.
Full Changelog
Bug Fixes
CI/Build
- Bump actions/upload-artifact from 6 to 7 by @dependabot[bot] in #72
- Bump actions/download-artifact from 7 to 8 by @dependabot[bot] in #73
- Bump version to 1.4.2 by @pmdevita in #76
Full Changelog: v1.4.1...v1.4.2
1.4.1
Shinobi 1.4.1 is a maintenance release, it adds support for Python 3.14 and Pydantic 2.12.
This release drops Python 3.8 support as it is EOL. Python 3.9 is also EOL now and will be dropped in 1.5.0.
Special thanks to @jwnwilson who contributed hybrid async auth! We unfortunately found additional issues after it was merged and had to pull it for this release, hopefully we'll be able to bring this back again sometime soon.
For contributors, there have been a number of improvements made to the CI and build that should help you. Using pull_request_target, tests should now run automatically for you when you open a PR, should be very helpful testing against the many different supported installations. The Pydantic version has also been pinned in the pre-commit mypy, which should make for less surprises when Pydantic inevitably updates and breaks a few things.
Full Changelog
Features
- Support Pydantic 2.12 by @pmdevita in #56
- feat: compatible with pydantic 2.12 and python 3.14 by @bolinocroustibat in #66
Docs
- Fix NINJA_COMPATIBILITY default value typo in docs by @ericpalakovichcarr in #48
Refactoring
Build/CI
- Fix docs build by @pmdevita in #44
- CI: Fix permissions for test comment action by @pmdevita in #45
- Bump actions/checkout from 4 to 5 by @dependabot[bot] in #42
- Bump actions/download-artifact from 4 to 5 by @dependabot[bot] in #43
- CI: Run tests under pull_request_target by @pmdevita in #49
- Bump actions/setup-python from 5 to 6 by @dependabot[bot] in #50
- Bump actions/download-artifact from 5 to 6 by @dependabot[bot] in #53
- Bump actions/upload-artifact from 4 to 5 by @dependabot[bot] in #54
- Bump actions/checkout from 5 to 6 by @dependabot[bot] in #57
- Fix mypy for Pydantic 2.12, limit pre-commit to Pydantic version by @pmdevita in #68
- Bump actions/upload-artifact from 5 to 6 by @dependabot[bot] in #59
- Bump actions/download-artifact from 6 to 7 by @dependabot[bot] in #58
- Fix tests running on PRs from forks by @pmdevita in #69
- Drop Python 3.8, add Django 6.0 by @pmdevita in #71
New Contributors
- @ericpalakovichcarr made their first contribution in #48
- @jwnwilson made their first contribution in #46
- @bolinocroustibat made their first contribution in #66
Full Changelog: v1.4.0...v1.4.1
1.4.0
Shinobi 1.4.0 is based on Ninja 1.4.3. You can read the changes for Ninja here.
You can find more info about the differences with Ninja in the docs.
Highlights
Schema performance improvements
It's taken a lot of work over the past few months but the performance improvements for Schema are now complete! When enabled, you should see a significant speed up in Schema validation. One particularly heavy response that was tested saw a 15x improvement in speed.
Before (~512ms):
After (~34ms):
Using the benchmarks from https://github.com/oscarychen/building-efficient-api, it looks like Shinobi scores about 20% faster in median time. Shinobi is still almost twice as slow as FastAPI, so there remains much more to do in optimization.
Choices support
ModelSchema now supports including a Field's choices in validation and the OpenAPI spec. You can also use TextChoices or
IntegerChoices to declare reusable Enum Schema, helpful for auto-generated API clients.
Auto-generated aliases now work with ForeignKey Fields
Previously, if you were using auto-generated aliases (to convert to camelCase, for example), any ForeignKey Fields you might
pull in with ModelSchema did not have their names aliased correctly. This is now fixed.
Primary keys and blanks are now opt-in nullable
Ninja 1.3.0 silently introduced a breaking change where any primary key or blank Model Fields would get marked as nullable by ModelSchema. This change broke the data contract you might make through your OpenAPI schema, as a primary key should never be null, and blank is a setting used for form validation. This has been reverted to the previous behavior.
I have little information about how this change affects users. If this breaks your use case, feel free to open an issue on Shinobi.
More robust testing and version support
Ninja's CI testing only checked coverage against one specific version of Python, Django, and Pydantic, meaning our visibility into how well Ninja supported your particular combination of installs was limited. This also meant version specific code had to be excluded from coverage, turning PR merging into a game of whack-a-mole.
Shinobi now checks all currently supported versions of Django, and their compatible Python and Pydantic versions, and
combines the coverage from them. From here, we can start removing coverage exclusions and find more blind spots in the tests.
Full Changelog
These are the full changes, including those released in 1.4.0a.
Features
- Improve performance by removing DjangoGetter by @pmdevita in #28
- ModelSchema: Add support for choices by @pmdevita in #23
Bug Fixes
- Use property to alias ForeignKey fields instead of Pydantic alias by @pmdevita in #7
- Fix tests on Pydantic 2.11 and sync Ruff version by @pmdevita in #11
- Fix primary key always being marked as nullable in schema by @pmdevita in #8
Docs
- Docs: Update dependencies, fix building by @pmdevita in #4
- Docs: Update contact links, more renames, link fixes by @pmdevita in #18
- Docs: Add Ninja migration guide by @pmdevita in #24
- Update docs and version for 1.4.0 by @pmdevita in #41
Build/CI
- CI: Set full_test runner to use Ubuntu 22 for Python 3.7 by @pmdevita in #10
- Build docs CI by @pmdevita in #13
- Increment version to 1.4.0a, use trusted publisher by @pmdevita in #14
- Combine coverage from all test runs by @pmdevita in #34
- Update support to only currently supported versions of Django and Python by @pmdevita in #37
- Merge Ninja 1.4.3 by @pmdevita in #40
Full Changelog: v1.4.0a...v1.4.0
v1.4.0a
Django Shinobi 1.4.0a
This is the first preliminary release for Shinobi, testing to make sure everything is in order. It contains a number of new features from upstream, as well as the foreign key alias fix and the fix for primary key and blank fields always being marked as nullable.
There was a miss where this release's tag marked a commit where the library still reports itself as 1.3.0. This will be fixed in the next release.
What's changed in Ninja
GitHub didn't generate release notes for this so I'm looking here, apologies if I miss anything. Not linking to avoid noise on the Ninja project from GitHub's backlinks.
Features
- Nested URL Parameters by vitalik
- Better error and explanation if schema used as default instead of annotation by vitalik
- Pydantic 2.9 compatibility by vitalik
- Made NinjaTestClient accept COOKIES by c4ffein
- Add pattern support to param by sunfkny
- Distinguish between AuthenticationError and AuthorizationError by c4ffein and vitalik
- Add IP4/6Network and Url serialisation by grigi
- add register_type public function by vitalik
- Support multi-period intervals in throttling by robhudson
- Add a method for customizing validation errors by jceipek
Bug Fixes
- Fix Router default options by Ksauder
- Fixed coverage on Python >= 3.11 by c4ffein
Docs
- Update pagination.md by syre
- Better csrf doc by c4ffein
- fix small type in throttling docs by noahgorstein
- Small typo fixes and doc mention router import by michaelg100
- document how to use an optional file input by toudi
- fix typos in docs by ahmetveburak
- Adding docs how to add a user in a test by pinguin999
- Updated docs for url parameters in nested routers by kentrh
- Replace update_forward_refs with model_rebuild in docs by Danie-1
What's Changed in Shinobi
CI
- Bump actions/checkout from 3 to 4 by @dependabot in #2
- Bump codecov/codecov-action from 4.4.1 to 5.1.2 by @dependabot in #1
- Docs: Update dependencies, fix building by @pmdevita in #4
- CI: Set full_test runner to use Ubuntu 22 for Python 3.7 by @pmdevita in #10
- Bump codecov/codecov-action from 5.1.2 to 5.3.1 by @dependabot in #9
- Build docs CI by @pmdevita in #13
Bug Fixes
- Use property to alias ForeignKey fields instead of Pydantic alias by @pmdevita in #7
- Fix tests on Pydantic 2.11 and sync Ruff version by @pmdevita in #11
- Fix primary key always being marked as nullable in schema by @pmdevita in #8
Other
New Contributors
- @dependabot made their first contribution in #2
- @pmdevita made their first contribution in #4
Full Changelog: v1.3.0...v1.4.0a

