Commit Graph

65 Commits (bc931677dcecff72f478a9a9f37073a815087d36)

Author SHA1 Message Date
Cristi Vîjdea acc204e4ea Add test for #382 2019-06-13 16:34:23 +03:00
Cristi Vîjdea d04f27f40f Add test for serializer field label
Closes #353.
2019-06-13 03:15:24 +03:00
Cristi Vîjdea 64d9d42aa9 Remove pygments test dependency 2019-06-13 01:54:22 +03:00
Terence Honles 91ef83e830 update reference.yaml based on pygments lexers & styles changes (#364)
Snippet model in testproj/snippets/models.py has field choices which depend
on ``pygments.lexers`` and ``pygments.styles``
2019-06-13 00:51:23 +03:00
Cristi Vijdea 4014c69689 Add test for #340 2019-04-01 02:58:07 +03:00
Dimas Ari 86c1675c58 make sure all ListModelMixin views considered as list view (#306)
* make sure all ListModelMixin views considered as list view
* test to make sure all ListModelMixin views considered as list view added
2019-04-01 02:57:14 +03:00
Cristi Vijdea b4900ebd6a Add tests for #310 2019-03-02 05:35:10 +02:00
Cristi Vijdea 3377ef08ea Fix Schema limits for ListField and ListSerializer
Fixes #324
2019-02-27 21:23:25 +02:00
Roman Sichny e538e0713a Support RecursiveField with 'many' option (#321) 2019-02-25 20:59:35 +02:00
Cristi Vîjdea 7ce62616d2 Re-add test for DELETE form param 2018-12-23 18:28:13 +02:00
Cristi Vîjdea b15535995f Add assertion against TYPE_ARRAY with no items 2018-12-23 15:32:06 +02:00
Cristi Vîjdea de950461c7 Fix absolute urls for swagger-ui oauth settings 2018-12-21 12:40:31 +02:00
Cristi Vîjdea b385228f7d Add mock OAuth2 provider to testproj 2018-12-21 01:07:11 +02:00
Cristi Vîjdea e182ab65ea Add x-nullable to paginator response fields
Closes #263.
2018-12-19 20:22:05 +02:00
Cristi Vîjdea c5d4e6ca53 Do not generate form parameters for read_only serializer fields
Fixes #261.
2018-12-19 03:22:43 +02:00
Cristi Vîjdea 852742baa9 Remove bad test case 2018-12-12 16:43:19 +02:00
Vitali Fokin f415a96aa6 Tags override support (#259) 2018-12-11 20:13:37 +02:00
Cristi Vîjdea 708e70a526 Use collectionFormat=multi for MultiChoiceField in query and formData
Fixes #257.
2018-11-29 01:38:40 +02:00
Cristi Vîjdea c2e4d7767b Update reference schema 2018-10-14 21:25:24 +03:00
Rémi Lapeyre d41f0c5ac4 Set x-nullable based on allow_null (#217)
Many fields may be set a nullable in an API. While not covered explicitly by Swagger 2, this information is usually indicated as a [vendor extension](https://swagger.io/docs/specification/2-0/swagger-extensions/) using the x-nullable field.
2018-10-10 01:24:42 +03:00
Cristi Vîjdea 9d330d9509 Use the first line of view method docstring as Operation summary
Closes #205.
2018-09-13 04:18:55 +03:00
Cristi Vîjdea 41b1ca4483 Do not bail on response when request body is formData 2018-09-10 00:02:39 +03:00
Cristi Vîjdea b109d4c847 Fix bad test for no_body 2018-09-09 23:14:09 +03:00
Nour Chawich 0837873f55 Add missing overrides to `swagger_auto_schema` (#194)
Add missing `operation_summary` and `deprecated` to `swagger_auto_schema` decorator data. The previous PR missed adding these to extra overrides.

- Added tests
- Updated reference.yaml

Refs #149, #173.
Closes #194, #198.
2018-09-09 22:15:50 +03:00
Cristi Vîjdea 9b56e1a4c8 Avoid invalid usage of readOnly 2018-08-09 04:27:08 +03:00
Cristi Vîjdea 37c00ab3fb Make swagger_schema_fields work on serializer Fields
Closes #167.
2018-08-07 22:54:24 +03:00
John Carter 748b5d3c2f Add support for SerializerMethodField (#179)
Closes #137, #179.
2018-08-07 21:23:36 +03:00
Cristi Vîjdea 9eb0db466c Fix Identity field names 2018-08-06 16:37:20 +03:00
Cristi Vîjdea 2965e08e39 Force descriptions to be str objects
Fixes #159
2018-08-03 20:27:31 +03:00
Cristi Vîjdea 9fa4765121 Ignore None when passed in as response override
Closes #148
2018-06-29 23:13:36 +03:00
Cristi Vîjdea 6ac58b8cf7 Fix testproj duplicate operation id
Fixes #139
2018-06-16 15:41:51 +03:00
Cristi Vîjdea 256a052564
Add ability to set Schema fields through the serializer Meta class (#134)
* Add swagger_schema_fields attribute to serializer Meta class
* Add documentation

Closes #132.
2018-05-31 00:15:21 +03:00
Cristi Vîjdea aca0c4713e
Allow body on HTTP DELETE view methods (#122)
* Allow body in delete requests
* Do not add request body to DELETE by default
* Check manual form parameters against body_methods
* Add tests
* Add changelog

Closes #118
2018-05-14 19:15:14 +03:00
Cristi Vîjdea f03d9d71e9 Fix SECURITY_DEFINITIONS and SECURITY_REQUIREMENTS ordering 2018-05-12 13:54:43 +03:00
Cristi Vîjdea a993cba7aa Fix default security requirements 2018-05-12 13:35:17 +03:00
Fabian Weisshaar 5b225423ae Set min_length=1 when allow_blank=False (#112) 2018-04-27 13:02:26 +03:00
Roman Sichny 979ec84630 Django rest framework recursive support (#110)
* add get_serializer_ref_name utility function
* implement RecursiveFieldInspector
* add option to allow non-existing reference in SchemaRef
* add examples and README
* Update changelog and docs
2018-04-27 01:51:10 +03:00
John Carter 322971f3e7 Make parameters order stable for multi-parameter URLs (#106)
Fixes #105

* Added intermittently failing test for #105
* Make parameter order stable for urls with multiple params
2018-04-23 19:16:22 +03:00
Cristi Vîjdea c9147a5746 Fix testproj people app 2018-03-18 20:20:04 +02:00
ko-pp 309a6eb8cd Fix schema generation with OneToOneFields (#81)
* Fix: OneToOneRel, used by OneToOneField doesn't have help_text nor primary_key attributes, thus breaking OpenAPISchemaGenerator; use hasattr() as safe-guard.
* Fix: use getattr() with a default value instead of hasattr() + acessing the value
* Add: 'people' app that breaks drf_yasg without previous commits
* Update tests/references.yaml + run isort and flake8
* Fix: set on_delete for Person.identity as Django-2+ requires it
2018-03-18 19:30:36 +02:00
John Carter fb240f6a5b Detect type of SlugRelatedField with readonly=True (#83)
* Added test for #82 - readonly SlugRelatedField not showing format uuid
* Added ArticleGroup model
* Added example of SlugRelatedField to a uuid field with and without readonly
* Check remote_field.model in get_related_model

Closes #82.
2018-03-10 13:29:20 +02:00
Cristi Vîjdea ee46f59fb1 Infer ChoiceField type from model field when in ModelSerializer
Fixes part of issue #69
2018-02-26 20:32:57 +02:00
Cristi Vîjdea f15e70b7db Fix missing assignment for default in openapi.Parameter 2018-02-22 20:33:47 +02:00
Cristi Vîjdea 64c280e222 Allow Response objects with no schema
Fixes #66.
2018-02-22 03:46:44 +02:00
Cristi Vîjdea d5073081d9
Fix ModelViewSet Nested bug (#65)
* Add todo repro app
* Add explicit test against model named "Nested"
* Force serializers named NestedSerializer to be output as inline models
* Allow ref_name to rescue a NestedSerializer
* Add tests and documentation
2018-02-22 03:46:16 +02:00
Cristi Vîjdea 97cd1b63d9 Take coerce_to_string into account when handling DecimalField
Closes #62.
2018-02-21 04:42:34 +02:00
Cristi Vîjdea a3e81ef7f6
Improve handling of consumes and produces attributes (#55)
* Fix get_consumes
* Generate produces for Operation
* Set global consumes and produces from rest framework DEFAULT_ settings
2018-01-24 14:44:00 +02:00
Cristi Vîjdea fc35d9043e
Add security requirements handling (#54)
* Add security requirements handling
* Update swagger-ui to 3.9.2, ReDoc to 1.20.0

Closes #39.
2018-01-23 12:43:25 +02:00
Cristi Vîjdea 6a478e14d7 Add overriden path parameter example 2018-01-11 21:20:54 +01:00
Cristi Vîjdea c4379dc6a7
Run testproj in a Heroku demo app (#38)
* Add Heroku configuration
* Add links in API description
* Read database connection string from DATABASE_URL environment variable
* Restructure settings files for production
* Run server using gunicorn and servce static files with whitenoise
* Install drf-yasg from source instead of pypi in testproj
* Add readme links to demo app
2018-01-10 10:18:22 +01:00