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
Gregory N. Schmit
335054a5d3
replace force_text with force_str
2019-08-07 21:05:24 +02:00
Reupen Shah
b45ff07294
Use an array type for list view response schemas
...
This is the first part of #6846 .
Previously, the response schema for list views was an object representing a single item. However, list views return a list of items, and hence it should be an array.
Further work will need to be done to support how pagination classes modify list responses.
There should be no change for views not determined to be list views.
2019-08-07 20:40:22 +02:00
Reupen Shah
a3f244d85e
Move AutoSchema serializer instantiation to common method
2019-08-07 20:40:22 +02:00
zeroohub
7e1c4be7ce
Avoided double call for remote url in FileField.to_representation. ( #6841 )
2019-08-06 12:31:46 +02:00
Min ho Kim
0e1c5d3132
Fix typos ( #6835 )
2019-07-25 10:04:01 -07:00
Chris Vigelius
ca727872c8
OpenAPI schemas: Ensure lazy field descriptions are converted to str(). ( #6832 )
2019-07-25 15:30:20 +02:00
Carlton Gibson
de26af4295
Move determine_path_prefix() logic into CoreAPI module.
2019-07-24 11:13:30 +02:00
Carlton Gibson
e309a4f0b8
Fix OpenAPI path generation with common prefixes.
...
Closes #6675 . Closes #6823 .
2019-07-24 11:13:30 +02:00
Daniel Alvarez
2138f558ce
Added mapping of ListField.child type for OpenAPI Schemas.
2019-07-24 11:09:57 +02:00
Muammar ibn Faisal
f7c3220fdb
Ability to specify urlconf in include_docs_urls added ( #6824 )
...
There is a problem in the current implementation that if one exports docs via `include_docs_urls` he will be using `ROOT_URLCONF` (https://github.com/encode/django-rest-framework/blob/master/rest_framework/schemas/generators.py#L73 ), which is a big problem, if one is working with subdomains and he has sets of disjoint URLs.
This simple fix allows to pass through forgotten `urlconf` parameter.
2019-07-23 12:06:03 +01:00
Tom Christie
044252af1c
Version 3.10.1 ( #6817 )
...
* Ensure that requiring 'uritemplate' does not also require 'coreapi'
* Don't include autocomplete fields on TokenAuth admin
* Version 3.10.1
2019-07-17 14:17:45 +01:00
Tom Christie
9eaf49dab9
Version 3.10 ( #6802 )
...
* 3.10 release notes
* Version number -> 3.10
* Update translations
* Update 3.10 release docs
* Update release notes
* Delete symlink
2019-07-15 12:31:09 +01:00
Ryan P Kilby
b26db12813
Update default settings to use lists instead of tuples ( #6799 )
...
* Update default settings from tuples to lists
* Add missing trailing commas
* Use single quotes for consistency
* Update settings lists in docs
2019-07-15 11:54:46 +01:00
Aarni Koskela
5c922fb39d
JSONEncoder: ensure empty listlikes remain lists, not dicts ( #6794 )
2019-07-09 11:41:05 +01:00
Tom Quinonero
7762aaa90f
Docs sidebar improvements ( #5638 ) ( #6589 )
...
* add sans-serif fallback for Verdana in docs sidebar
Co-Authored-By: Joachim Jablon <ewjoachim@gmail.com>
* improve display for docs sidebar (#5638 )
Co-Authored-By: Joachim Jablon <ewjoachim@gmail.com>
2019-07-08 13:05:13 +01:00
Ryan P Kilby
bd6a1b3b6c
Fix dotted-source field checking on serializer write ( #6786 )
...
* Add tests for raise_errors_on_nested_writes
* Fix dotted-source field checking on serializer write
The code was previously checking the validated data for the field's
attribute name, however, the data contain the first source attr.
2019-07-08 11:10:18 +01:00
Ryan P Kilby
976739206c
Don't render extra actions when unauthenticated ( #6775 )
2019-07-04 14:54:16 +01:00
Ryan P Kilby
e4e75f1c7c
Strip null characters from search param ( #6774 )
2019-07-02 11:33:48 -07:00
Ryan P Kilby
41d5338ba6
Translate Throttled exception messages ( #6771 )
2019-07-02 11:21:40 +01:00
Ryan P Kilby
da06240257
Fix ModelField max_length argument ( #6773 )
2019-07-01 19:14:45 -07:00
Karambir Singh Nain
a7778897ad
Fix ArrayField kwargs mapping for blank/allow_empty ( #6758 )
...
Postgres ArrayField blank=True should allow empty Lists in Serializer
2019-07-01 17:34:34 -07:00
Reupen Shah
3242adf058
Enforce allow_empty=False during partial validation of parent serializer ( #6512 )
...
Refs #6509
This enforces allow_empty=True when a ListSerializer is a child of another serializer and partial validation is being performed on the parent serializer.
This is because partial validation should allow fields to be omitted, but should not cause values that are invalid without partial validation to become valid.
This effectively reverts #4222 . None of the tests added in that PR fail if the associated change is removed, so I‘m not sure what that PR was trying to fix.
2019-07-01 13:30:16 +01:00
Michael
79b2350b54
[fields] Format error message only if params exist ( #6624 )
...
This prevents exceptions when the error message contains `%`, but is
not intended for formatting. Django itself does the same:
6866c91b63/django/core/exceptions.py (L168-L169)
Fixes encode/django-rest-framework#6622
2019-07-01 13:28:16 +01:00
Ryan P Kilby
7179ea9984
Raise exception when field source is a built-in ( #6766 )
2019-07-01 13:25:47 +01:00
Ryan P Kilby
91ea138406
Allow redundant SerializerMethodField method names ( #6767 )
2019-07-01 13:22:03 +01:00
Greg Curtis
42fd179d4e
upgrade jQuery to latest version ( #6728 )
2019-07-01 13:16:21 +01:00
Ryan P Kilby
df1d146ee7
Remove old documentation ( #6765 )
2019-06-28 16:03:00 -07:00