Commit Graph

35 Commits (728c02356c70c457c7378e66fe5a9a36a9549fcf)

Author SHA1 Message Date
Cristi Vîjdea 7491d330a8 Fix ugettext_lazy warning 2020-02-17 03:12:59 +02:00
Cristi Vîjdea e9f27442fc Remove unused import 2019-06-13 16:58:41 +03:00
Cristi Vîjdea 3a37c4a019 Drop Django 2.0 and DRF 3.7 support 2019-06-13 16:49:46 +03:00
Cristi Vijdea b57413023b Fix isort 2019-04-01 02:58:42 +03:00
Cristi Vijdea 340a60324c Add special exclusion for FileUploadParser
Fixes #288
2019-03-04 00:48:55 +02:00
Cristi Vijdea 75a5d866be Run makemigrations 2019-03-02 05:51:15 +02:00
Cristi Vijdea b4900ebd6a Add tests for #310 2019-03-02 05:35:10 +02:00
Cristi Vîjdea 7ce62616d2 Re-add test for DELETE form param 2018-12-23 18:28:13 +02:00
Cristi Vîjdea bfd13668cc Fix deprecation warnings 2018-12-21 16:07:48 +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
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 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
werwty 408b31fc4f Avoid marking read_only fields as required (#133)
* Avoid marking read_only fields as required

Read only properties cannot be marked as required by a schema.
2018-05-30 21:56:52 +03:00
Cristi Vîjdea 7270154828
Test with Django Rest Framework 3.8 (#96)
* Add djangorestframework 3.8 to tox and travis
* Add @action tests
* Limit tox to <3.0.0
2018-04-04 22:59:57 +03:00
Cristi Vîjdea a64ce95e3c Reset testproj migrations
Heroku deployment issues...
2018-03-18 20:35:02 +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 d39764d383 Add isort 2017-12-27 20:23:05 +01:00
Cristi Vîjdea c89f96fcb0
Prepare for 1.1.0 (#30)
* refactor the view inspection process to be more modular and allow recursive customization
* add operation_id argument to @swagger_auto_
* add inspections for min/max validators
* add support for URLPathVersioning and NamespaceVersioning
* integrate with djangorestframework-camel-case
* fix bugs, improve tests and documentation
2017-12-26 22:50:59 +01:00
Cristi Vîjdea 43034ddc4b Fixed assumption of dict ordering 2017-12-23 12:04:02 +01:00
Cristi Vîjdea 9f6ee4da87 Improve RelatedField and callable default handling
- callable default values will now be properly called 
  - PrimaryKeyRelatedField and SlugRelatedField will now return an appropriate type based on the relation model's Field
  - mock views now have a request object bound even when public is True
2017-12-23 11:52:57 +01:00
Cristi Vîjdea 8a8a9faeeb Fix swagger Try it out and make endpoints work 2017-12-21 17:20:46 +01:00
Cristi Vîjdea 6060192a89 Update changelog and clean up code 2017-12-18 14:23:57 +01:00
Cristi Vîjdea 06a461ec09
Merge pull request #21 from h-hirokawa/file-field-response
Add support for FileField response.
2017-12-18 13:16:21 +01:00
h-hirokawa 16b697b40d Add a field to ArticleSerializer in testproj for coverage. 2017-12-18 19:31:32 +09:00
h-hirokawa 8a0d5a964d Add support for serializers.FileField response. 2017-12-18 19:03:40 +09:00
Cristi Vîjdea 8a5be407e2 Document exotic usages of swagger_auto_schema
method_decorator works out of the box so might as well document an example
2017-12-16 20:38:40 +01:00
Cristi Vîjdea f6a535eb45 Do not attempt to generate a response schema for form-only requests
It would probably fail because Schema objects cannot represent files
2017-12-15 11:14:47 +01:00
Cristi Vîjdea c66f7e8e01 Rename to drf-yasg
drf-swagger was already taken
2017-12-13 10:22:03 +01:00
Cristi Vîjdea 8883894775
Add more tests and cleanup coverage reports (#13)
Closes #11
2017-12-12 17:30:58 +01:00
Cristi Vîjdea bfced82ae4
Add suport for Response schemas (#10)
Schemas generated from Serializers will now be added to the `definitions` section by default, and used as `$ref` objects where needed.  
The Schema definition name is based on the serializer class name, and can be overriden by specifying a `__ref_name__` property on the Serializer. If this property is set to None, the schema will not be added to `definitions` and will be forced inline.

Closes #6, #7.
2017-12-10 03:06:49 +01:00
Cristi Vîjdea 652795f5db Add swagger_auto_schema method decorator for Operation customization
See #5.
2017-12-08 17:45:00 +01:00
Cristi Vîjdea dce00156d5
Rewrite schema generation (#1)
* Completeley rewritten schema generation
* Added support for python 2.7 and 3.4
* Restructured testing and build configuration
* Added nested request schemas

This rewrite completely replaces the public interface of the django rest schema generation library, so 
further changes will be needed to re-enable and further extend the customization points one might want.
2017-12-05 19:46:02 +01:00