-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix serialization of Link/BackLink and OpenAPI schema generation (#1080)
* fix: serialization and JSON schema generation in Python and FastAPI contexts * tests: write tests for serialization and JSON schema generation * Fix typo Co-authored-by: Adeel Ahmed <[email protected]> --------- Co-authored-by: Adeel Ahmed <[email protected]>
- Loading branch information
1 parent
a2e6a5a
commit ff5ca5b
Showing
12 changed files
with
511 additions
and
176 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,19 @@ | ||
from json import dumps | ||
|
||
from fastapi.openapi.utils import get_openapi | ||
|
||
from tests.fastapi.app import app | ||
|
||
|
||
def test_openapi_schema_generation(): | ||
openapi_schema_json_str = dumps( | ||
get_openapi( | ||
title=app.title, | ||
version=app.version, | ||
openapi_version=app.openapi_version, | ||
description=app.description, | ||
routes=app.routes, | ||
), | ||
) | ||
|
||
assert openapi_schema_json_str is not None |
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
Oops, something went wrong.