-
Notifications
You must be signed in to change notification settings - Fork 35
fix: schema generation with type keyword (#84) #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
I'm not sure why |
tests/test_openapi.py
Outdated
| ), | ||
| ) | ||
| return api_dir | ||
| return request.param |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not change the fixture return type.
If you need access to some of the fixture params, you can follow one of the two ways:
- return a "smart" object and access its attributes
- create a fixture and access/control params through it
I would prefer the second method for this case:
@pytest.fixture(params=['no-collide', 'collide'])
def api_package_signature(request):
return request.param
@pytest.fixture()
def api_package(..., api_package_signature):
...
tests/test_openapi.py
Outdated
| else: | ||
| assert web_request_ref != mobile_request_ref | ||
| assert web_request_ref.split('/')[-1] in schemas | ||
| assert mobile_request_ref.split('/')[-1] in schemas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we bring back hard-coded values to make the test clearer about which values are expected?
| ) | ||
|
|
||
| self.shared_dependant = clone_dependant(self.dependant) | ||
| self.shared_dependant = copy.copy(self.dependant) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dependant is dataclass since 0.112.3 fastapi/fastapi@581aacc
Min required fastapi version here is 0.112.4.
Reason for change - Dependant signature was changed in 0.123.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please up fastapi version in requirements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not necessary. Current change is valid for all versions since 0.112.3
schema['title']if there is no 'title'request_responsefrom fastapi required in latest fastapi version. In previous fastapi versions there is an import from starlette (fastapi/fastapi@e329d78#diff-4d573079004a9f3d148baa4658e68e82b8a3d1a95d603fee8177daa92cf65c93)test_no_collide, because now fastapi generates schema with full nameapi.mobile._Response[probe]even if it's not necessary