Commit Graph

37 Commits (c510de13d7d1d075d8914098c5d0a83f502d4715)

Author SHA1 Message Date
Cristi Vîjdea c510de13d7 Do not try to use inspect.signature on Python 2.7
Fixes #222.
2018-10-10 00:35:43 +03:00
Cristi Vîjdea cbae10c434 Refactor CamelCaseJSONFilter to be more extensible 2018-10-09 01:37:32 +03:00
Cristi Vîjdea 120c4dd884 Fix IPv4 pattern on Django 1.11 2018-09-13 05:14:08 +03:00
Cristi Vîjdea 586b88d8f3 Allow pattern on any field 2018-09-13 03:34:01 +03:00
Cristi Vîjdea 90812f5c43 Refactor get_queryset_from_view 2018-09-10 14:34:30 +03:00
Cristi Vîjdea 6820d6bc70 Fix RelatedFieldInspector nesting issues 2018-09-10 05:04:03 +03:00
Cristi Vîjdea c5c40e31c4 Log regex compilation failure in find_regex
Closes #193.
2018-09-09 22:33:13 +03:00
Terence D. Honles f9b215deab Fix missing backslashes found via pytest 3.8 (#202)
See: https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals

Changed in version 3.6: Unrecognized escape sequences produce a DeprecationWarning

Closes #202.
2018-09-09 22:17:04 +03:00
Julian Bez 02b8848912 Fix error when using typing classes (#195)
Closes #195.
2018-09-09 22:11:29 +03:00
Cristi Vîjdea 9b56e1a4c8 Avoid invalid usage of readOnly 2018-08-09 04:27:08 +03:00
Cristi Vîjdea 23ebba4207 Rename swagger_serializer_method parameter and update docs 2018-08-08 01:41:54 +03:00
Cristi Vîjdea 12f1d23048 Fix lint errors 2018-08-08 01:24:36 +03:00
Cristi Vîjdea 5cd642c9a0 Show warning on ref_name collisions
Closes #156
2018-08-08 00:58:35 +03:00
Cristi Vîjdea 37c00ab3fb Make swagger_schema_fields work on serializer Fields
Closes #167.
2018-08-07 22:54:24 +03:00
Cristi Vîjdea 4c069138e8 Fix lint errors 2018-08-07 21:24:36 +03:00
John Carter 748b5d3c2f Add support for SerializerMethodField (#179)
Closes #137, #179.
2018-08-07 21:23:36 +03:00
Andrew Yager 4825ec70b1 Handle swagger_extra_fields in field_to_swagger_object (#142)
* Move add_manual_fields call to make_schema_definition
* Do not call add_manual_fields twice
2018-06-16 17:02:06 +03:00
Cristi Vîjdea 58adbb8f4c Coerce read_only into a boolean 2018-06-01 15:36:37 +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 cc90bc1544 Add some coverage exemptions 2018-05-30 22:33:36 +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
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
Cristi Vîjdea c0f37f6ec1 Avoid crash when hitting unknown model fields
Fixes #102
2018-04-25 22:41:06 +03: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
John Carter 2c459024d1 Handle django rest framework HiddenField (#79)
* Added HiddenFieldInspector (#78)
* Updated docs + added test for HiddenField

Added HiddenField to testproj (no change in yaml as expected)

Closes #78.
2018-03-09 22:46:47 +02:00
Cristi Vîjdea 9ad55bac99 Guard against attempted deletion of inexistent attributes
Fixes #76
2018-03-05 19:59:03 +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 b38d3e6805 Do not set pattern on non-string values
Fixes #68
2018-02-23 18:51:55 +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 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
Cristi Vîjdea 02b72c466e Do not generate readOnly outside Schema properties 2018-01-01 19:16:20 +01:00
Cristi Vîjdea d39764d383 Add isort 2017-12-27 20:23:05 +01:00
Cristi Vîjdea 60e266fe99 Make sphinx document CamelCaseJSONFilter 2017-12-27 20:14:12 +01:00
Cristi Vîjdea c85acee405 Convert regex '\Z' to '$'
See https://github.com/swagger-api/swagger-editor/issues/1601.
2017-12-27 03:00:47 +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