Vlad
e215db206a
Updated url()'s with path() and re_path() ( #7492 )
2020-08-25 13:50:02 +02:00
Justin Duke
48c327c681
Fix schema typo ( #7491 )
2020-08-24 03:44:34 -07:00
David Smith
355afcf64b
isort v5 ( #7484 )
2020-08-17 13:26:56 -07:00
Ryan P Kilby
1e383f103a
Check extra action func.__name__ ( #7098 )
2020-08-05 21:29:47 -07:00
Michael K
0d2bbd3177
Fix Request docstring kwarg names ( #7443 )
2020-08-05 16:51:06 -07:00
John Vandenberg
599e2b183d
urlpatterns: Remove unnecessary branching ( #7405 )
...
Functions path and register_converter are constants.
2020-07-23 19:26:35 +02:00
Anton Agestam
76232437d4
Allow type checkers to make serializers generic ( #7385 )
2020-07-07 10:05:36 +01:00
Minjae Kim
d46d5cbaaa
Not include charset when charset is None ( #7400 )
2020-07-07 09:58:32 +01:00
Xavier Ordoquy
28983cb28b
Merge pull request #7290 from encode/xordoquy/fix_action_namespace
...
Fix viewsets action urls with namespaces (#7287 )
2020-07-03 20:18:18 +02:00
Dhaval Mehta
5ce237e004
Corrected regex serialization for OpenAPI. ( #7389 )
...
* replace \Z by \z in regex
* fix test cases for Django >= 3.0
* fix isort
* Added comment for why `\z`.
Co-authored-by: Carlton Gibson <carlton@noumenal.es>
2020-06-28 14:28:59 +02:00
Carlton Gibson
e2bd3b6a57
Adjusted token admin to map to user ID. ( #7341 )
...
Closes #6131 .
* Adds a proxy model for Token that uses the user.pk, rather than it's own.
* Adjusts Admin to map back from User ID to token instance.
2020-06-15 11:43:09 +01:00
Jair Henrique
bb795674f8
Drop all compat support to Django < 2 urls ( #7337 )
2020-05-14 20:31:38 +02:00
Jair Henrique
65add6679d
Remove unnecessary test skips ( #7336 )
2020-05-14 14:49:04 +01:00
Jair Henrique
b83e9121f3
Remove compat urls for Django < 2.0 ( #7335 )
2020-05-14 14:48:14 +01:00
Jair Henrique
aed74961ba
Remove compat for ProhibitNullCharactersValidator ( #7333 )
2020-05-14 08:24:09 +01:00
johnthagen
fccfdd21c0
Remove object inheritance in docs ( #7332 )
2020-05-13 17:54:46 -07:00
Carlton Gibson
8bb9a37f4b
Removed duplicated class RemovedInDRF314Warning.
...
Added accidently in e888fc11c7
Co-authored-by: Jair Henrique <jair.henrique@gmail.com>
2020-05-13 20:41:53 +02:00
Kevin Brown
e888fc11c7
Merge NullBooleanField with BooleanField(allow_null=True) ( #7122 )
...
* Make `NullBooleanField` subclass `BooleanField`
This removes a lot of the redundancy that was in place becuase we
were not doing this. This maintains the `None` initial value that
was previously present, as well as disallowing `allow_null` to be
passed in.
* Remove special case for mapping `NullBooleanField`
In newer versions of Django, the `NullBooleanField` is handled the
same way as a `BooleanField(null=True)`. Given that we also support
that combination, and that our own `NullBooleanField` behaves in the
same manner, it makes sense to remove the special casing that exists
for it.
* Add test for BooleanField(null=True, choices)
* Remove special case for NullBooleanField
* Adjust mapping tests for NullBooleanField
* Fixed linting error
* Raise deprecation warning when NullBooleanField is used
* Fix linting issue in imports
2020-05-13 14:59:04 +01:00
Ryan P Kilby
089162e6e3
Fix ModelSerializer unique_together handling for field sources ( #7143 )
...
* Fix ModelSerializer unique_together field sources
Updates ModelSerializer to check for serializer fields that map to the
model field sources in the unique_together lists.
* Ensure field name ordering consistency
2020-05-13 11:11:26 +01:00
Asif Saif Uddin
1260ed424a
jquery 3.5.1 ( #7313 )
...
* jquery 3.5.1
2020-05-11 13:08:40 +01:00
Ryan P Kilby
8a38991d6a
Fix SearchFilter.must_call_distinict for annotation+m2m ( #7146 )
...
* Test SearchFilter annotation+m2m distinct
* Fix SearchFilter annotation+m2m distinct
2020-05-11 10:55:39 +01:00
Daniil Okhlopkov
4ac0fae75b
use @admin decorator ( #7022 )
2020-05-11 09:04:37 +01:00
Mathieu Pillard
d7777ea10f
Pass custom code to PermissionDenied if permission class had one set ( #7306 )
2020-05-01 10:22:36 +01:00
Ryan P Kilby
e275b9036a
Allow context to be provided to get_serializer ( #7298 )
...
* Test generics serializer behavior
* Allow context to be provided to get_serializer
2020-04-29 11:19:44 +01:00
Xavier Ordoquy
bda84372d4
Fix viewsets action urls with namespaces ( #7287 )
...
Use the current request's namespace to resolve action urls.
2020-04-25 19:50:59 +02:00
Dhaval Mehta
e1336387d1
Added example
for pagination in schemas. ( #7275 )
2020-04-24 16:13:13 +02:00
Matthaus Woolard
812f254bbd
SearchFilter to support JSONField and HStoreField ( #7121 )
...
* SearchFilter to support Custom query Transforms
Since Some fields support `__` as a custom Transform for query lookups we needed to update the m2m checking code to handle search_fields that contain __ that are not relationships.
* Update documentation on SearchFilter to include references to JSON and HStore Fields.
2020-04-23 09:38:14 +01:00
Byron Peebles
676aa77223
Fix punctuation in system check ( #7281 )
2020-04-20 16:40:05 -07:00
Carlton Gibson
b2497fc245
Convert openapi.AutoSchema methods to public API.
2020-04-09 20:05:16 +02:00
Carlton Gibson
d45e0005f3
Updated deprecation warnings for 3.12
2020-04-09 20:05:16 +02:00
Carlton Gibson
b1bfff4f1c
Revert "Schemas: Improved decimal handling when mapping ChoiceField. ( #7264 )"
...
This reverts commit 1872bde462
.
2020-04-09 19:35:46 +02:00
Dhaval Mehta
1872bde462
Schemas: Improved decimal handling when mapping ChoiceField. ( #7264 )
2020-04-09 19:18:00 +02:00
Clinton Blackburn
603aac7db1
Corrected OpenAPI schema type for DecimalField ( #7254 )
2020-04-09 19:16:17 +02:00
Dhaval Mehta
41f27c3b43
Schemas: Don't generate component for DELETE method. ( #7229 )
2020-04-09 19:10:50 +02:00
François Freitag
e6c1afbcf9
Tighten checks for invalid field name in ordering ( #7259 )
...
Django master removed the ORDER_PATTERN regex with commit
513948735b
2020-04-07 12:28:09 +02:00
Ryan P Kilby
dd33ebb4e2
Add Request repr ( #7239 )
2020-03-29 12:01:14 +01:00
Ryan P Kilby
908f91d8ef
Set action for HEAD requests ( #7223 )
...
* Test viewset action attr
* Add 'head' to viewset actions map
2020-03-09 09:43:02 +00:00
Tom Christie
73f7bf4941
Extra action detection is too permissive. Add failing test + fix ( #7217 )
...
* Add failing test
* Add failing test++
* Make get_extra_action less permissive
2020-03-05 10:18:22 +00:00
Martin Desrumaux
6a23fa0649
OpenAPI: Make operationId camelCase, matching spec examples. ( #7208 )
2020-03-03 17:51:51 +01:00
Martin Desrumaux
609f708a27
Fix schema generation for ObtainAuthToken view. ( #7211 )
2020-03-03 13:27:34 +01:00
Martin Desrumaux
8aa8be7653
Implement OpenAPI Components ( #7124 )
2020-03-02 19:35:27 +01:00
Martin Desrumaux
797518af6d
OpenAPI: Warn user about duplicate operationIds. ( #7207 )
2020-03-02 16:44:06 +01:00
Martin Desrumaux
5b16a17242
OpenAPI: Allow customizing operation name. ( #7190 )
2020-03-02 16:40:18 +01:00
Mateusz Legięcki
94a09149b6
OpenAPI: Use 201 status code for POST requests. ( #7206 )
2020-03-02 16:32:26 +01:00
Dhaval Mehta
2a5c2f3f70
Added OpenAPI tags to schemas. ( #7184 )
2020-02-28 12:06:03 +01:00
Kevin Kennell
d7b218f5eb
decode base64 credentials as utf8; adjust tests ( #7193 )
...
* decode base64 credentials as utf8; adjust tests
* basicauth: add dedicated test for utf8 credentials
* basicauth: add fallback to latin-1 encoding if utf-8 fails
2020-02-17 16:10:52 +00:00
Thorsten
f81ca78642
Add file option to generateschema ( #7130 )
2020-02-12 20:35:54 +01:00
Thorsten
4137ef41ef
Disable yaml aliases for schema generation. ( #7131 )
2020-02-03 14:41:47 +01:00
Kentalot
79d37bce4c
OpenAPI: Include type key in schema object properties dict. ( #7169 )
2020-01-30 12:14:17 +01:00
Dhaval Mehta
bc4d52558b
Schemas: Add mapping of type for ChoiceField. ( #7161 )
2020-01-29 19:15:56 +01:00
Stella
160f912a60
Schemas: Handle default=false for boolean fields ( #7165 )
2020-01-29 10:20:51 +01:00
Fábio Domingues
d22daf4e05
OpenAPI: Use _get_serializer() in _get_operation_id() ( #7160 )
2020-01-26 19:13:08 +01:00
Fábio Domingues
e4a26ad58a
Corrected _get_serializer() argument order. ( #7156 )
2020-01-23 15:53:47 +01:00
Kevin Brown
98c8af5291
ListField
mapping should map all options for the child
...
Previously it was only mapping the `type` and `format`, even though
for some field types (like a `MultipleChoiceField`) we map more
than just these. And for some fields (like a `ChoiceField`) we do
not map the `type` at all.
2020-01-21 20:45:07 +01:00
Carlton Gibson
496947be3a
Inline unnecessary method in OpenAPI schema generator.
2020-01-21 20:05:13 +01:00
Carlton Gibson
d0b9577605
Return valid OpenAPI schema even when empty.
2020-01-21 20:05:13 +01:00
Ryan P Kilby
5f3f2ef106
Add note that APISettings is an internal class ( #7144 )
2020-01-15 10:52:29 +00:00
Sebastian Pipping
373e521f36
Make CharField prohibit surrogate characters ( #7026 ) ( #7067 )
...
* CharField: Detect and prohibit surrogate characters
* CharField: Cover handling of surrogate characters
2020-01-06 14:12:21 +00:00
Tom Christie
430a567258
Update openapi.py
2020-01-03 13:50:26 +00:00
Noam
ced37a56cb
Avoid outputting callable defaults to schema. ( #7105 )
2020-01-03 13:49:46 +00:00
Ran Benita
62ae241894
Remove outdated comment in SerializerMethodField ( #7110 )
...
Since 91ea138406
.
2020-01-02 14:52:05 +00:00
Ran Benita
d985c7cbb9
Remove a few no longer needed compat checks and references ( #7092 )
...
* serializers: removes no longer needed compat checks
UUIDField and DurationField are both supported in all supported Django
versions.
IPAddressField was removed in Django 1.9, which is no longer supported.
* serializers: move related code closer together
This way it's easier to see all of the mappings in one place.
* serializers,docs: remove some DRF 2.x references
The last release of DRF 2.x was 5 years ago, it seems fine to remove
these references now.
2019-12-16 18:59:25 +00:00
Tom Christie
de497a9bf1
Version 3.11 ( #7083 )
...
* Version 3.11
* Added notes on OpenAPI changes for 3.11.
* Minor docs tweaking
* Update package version and supported versions
* Use a lazy import for django.test.client.encode_mutlipart. Closes #7078
2019-12-12 14:31:40 +00:00
Jordan Ephron
3c1428ff79
Fix NotImplementedError for Field.to_internal_value and Field.to_representation ( #6996 )
2019-12-12 14:09:34 +00:00
Ryan P Kilby
b8c369c4cf
Fix serializer multiple inheritance bug ( #6980 )
...
* Expand declared filtering tests
- Test declared filter ordering
- Test multiple inheritance
* Fix serializer multiple inheritance bug
* Improve field order test to check for field types
2019-12-12 14:03:55 +00:00
Ryan P Kilby
236667b717
Fix UniqueTogetherValidator with field sources ( #7086 )
...
* Add failing tests for unique_together+source
* Fix UniqueTogetherValidator source handling
* Fix read-only+default+source handling
* Update test to use functional serializer
* Test UniqueTogetherValidator error+source
2019-12-12 13:02:30 +00:00
Aarni Koskela
f744da74d2
Improve the docstring on @action ( #6951 )
2019-12-11 15:08:54 -08:00
Ryan P Kilby
de9f1d56c4
Followup to set_context removal ( #7076 )
...
* Raise framework-specific deprecation warnings
- Use `RemovedInDRF313Warning` instead of DeprecationWarning
- Update to follow deprecation policy
* Pass serializer instead of model to validator
The `UniqueTogetherValidator` may need to access attributes on the
serializer instead of just the model instance. For example, this is
useful for handling field sources.
* Fix framework deprecation warning in test
* Remove outdated validator attribute
2019-12-11 08:44:08 +00:00
Roy Segall
ebcd93163a
Adding I'm a teapot error code ( #7081 )
2019-12-10 09:18:35 +00:00
Ryan P Kilby
90eaf51839
Update framework deprecation warnings ( #7075 )
...
- Bump version numbers for deprecation warnings
- Drop deprecated features
2019-12-04 16:18:38 -08:00
Ryan P Kilby
95d4843abe
Fix Django 3.0 deprecations ( #7074 )
2019-12-04 14:14:43 -08:00
Hasan Ramezani
4d9f9eb192
Changed default widget for TextField with choices to select ( #6892 )
2019-12-04 12:24:49 -08:00
Tom Christie
070cff5a03
Drop set_context()
( #7062 )
...
* Do not persist the context in validators
Fixes encode/django-rest-framework#5760
* Drop set_context() in favour of 'requires_context = True'
2019-12-03 11:16:27 +00:00
Tom Christie
fe840a34ff
Escape hyperlink URLs on lookup ( #7059 )
...
* Escape hyperlink URLs on lookup
* Rename duplicate test
2019-11-21 11:38:40 +00:00
Chris Guo
cad1b08260
Fix override func style and regular usage ( #7050 )
...
* style: add space and rm redundant parentheses
* refactor: use super to replace inherit class
* Prefer explicit tuple syntax
2019-11-18 12:30:36 +00:00
Maxime Jacques
8988afa082
Update bootstrap to 3.4.1 ( #6923 )
2019-11-11 16:41:10 -05:00
Yann Savary
0d3d548aa5
OpenAPI: Fixed generation when title or version not provided. ( #6912 )
2019-11-06 21:54:12 +01:00
Yann Savary
7c3477dcda
OpenAPI: Ported docstring operation description from CoreAPI inspector. ( #6898 )
2019-11-06 21:52:02 +01:00
Kentalot
becb962160
OpenAPI: Use int64 format for large integers. ( #7018 )
2019-11-06 21:46:19 +01:00
Dima Knivets
8b06ce72d7
OpenAPI: Map renderers/parsers for request/response media-types. ( #6865 )
2019-11-06 21:44:51 +01:00
Tom Christie
82f2569895
Update __init__.py
2019-11-05 16:43:32 +00:00
Erwan Rouchet
39bd6cc5cb
Set the proper JSON schema type for HStoreFields in OpenAPI schemas ( #6914 )
2019-10-27 21:13:01 -04:00
Jeremy Lainé
c9f06bf73f
Fix a spelling error in openapi AutoSchema method ( #7004 )
...
Replace "pagninator" by "paginator".
2019-10-24 10:51:16 +02:00
Ryan P Kilby
a8c86be660
Update linter requirements ( #7010 )
2019-10-22 11:18:51 -07:00
Sergey
43397a81ae
Fixed decimal snan deserialization ( #7002 )
...
* Added test case causes exception in DecimalField deserialization
* Fixed NaN checking which throws exception with sNaN value
2019-10-22 10:06:37 +01:00
Guilherme Munarolo
0fd72f17ee
Fixed crash deleting required schema parameter key on PATCH requests. ( #6944 )
...
Closes #6941
2019-10-10 08:50:20 +02:00
Francisco Couzo
37dcd55370
Fix bug in escape_curly_brackets ( #6909 )
2019-10-04 13:50:19 -07:00
mehrab
b4db2dfacf
Fixed no-cls-argument on staticmethod __new__
( #6960 )
2019-10-04 12:40:09 -07:00
Konstantinos Tselepakis
30e56f62ba
Fix nested write of non-relational fields ( #6916 )
2019-10-03 09:33:37 -07:00
Mariusz Felisiak
75afe48b6c
Fixed import of FieldDoesNotExist exception.
2019-09-28 20:52:22 +02:00
Tom Christie
89ac0a1c7e
Version 3.10.3 ( #6908 )
...
* Version 3.10.3
* Version 3.10.3 release notes
2019-09-04 14:28:25 +01:00
Tom Christie
4b30b32014
Default OpenAPI version to the empty string ( #6907 )
2019-09-04 12:53:50 +01:00
Yann Savary
e57c1505fc
Replaced 'TODO' hardcoded version info by a parameter with default '0.1.0' ( #6899 )
2019-09-03 16:07:30 +02:00
Peter J. Farrell
b3f032fb8f
Fixed #6875 -- Made OpenAPI Schema operationId casing consistent. ( #6876 )
2019-09-03 16:05:43 +02:00
Dima Knivets
1cc4be47b4
Fixed min/max attributes for serializers.ListField ( #6866 )
2019-09-03 15:43:54 +02:00
Reupen Shah
f8c16441fa
Add support for pagination in OpenAPI response schemas ( #6867 )
...
Refs #6846
This provides a way for pagination classes to add pagination properties (`count`, `next`, `results` etc.) to OpenAPI response schemas.
A new method `get_paginated_response_schema()` has been added to `BasePagination`. This method is intended to mirror `get_paginated_response()` (which takes a `list` and wraps it in a `dict`).
Hence, `get_paginated_response_schema()` takes an unpaginated response schema (of type `array`) and wraps that with a schema object of type `object` containing the relevant properties that the pagination class adds to responses.
The default implementation of `BasePagination.get_paginated_response_schema()` simply passes the schema through unmodified, for backwards compatibility.
2019-09-03 15:25:44 +02:00
Christopher Grebs
5a8736ae45
Handle 'None' return value of wait() properly during throttling. ( #6837 )
2019-08-12 11:36:05 -07:00
Dima Knivets
a142467586
Fixed incorrect OpenAPI response schema generation for a DELETE method in generic views ( #6860 )
2019-08-09 15:02:41 +02:00
Chris Vigelius
f7dc6b5656
OpenAPI: Added required description to responses. ( #6850 )
2019-08-07 22:09:27 +02:00
Chris Vigelius
0ebfbfdf81
OpenAPI: only include non-empty required property. ( #6851 )
...
Closes #6834
2019-08-07 21:40:21 +02:00