-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exclude callable field defaults from the OpenAPI schema (#1167)
* Exclude callable field defaults from the OpenAPI schema * Organize callable default test in line with project standards
- Loading branch information
1 parent
126cd9f
commit b7dd585
Showing
4 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from rest_framework_json_api.schemas.openapi import AutoSchema | ||
from tests.serializers import CallableDefaultSerializer | ||
|
||
|
||
class TestAutoSchema: | ||
def test_schema_callable_default(self): | ||
inspector = AutoSchema() | ||
result = inspector.map_serializer(CallableDefaultSerializer()) | ||
assert result["properties"]["attributes"]["properties"]["field"] == { | ||
"type": "string", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters