-
Notifications
You must be signed in to change notification settings - Fork 0
Update testing dependencies #22
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
5560e4a to
e2efd31
Compare
jakeane
left a comment
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.
None linting changes here. Should not cause any changes to existing logic
| assert issubclass(value, BaseModel), "invalid `pydantic.BaseModel`" | ||
| self.code_models[key] = value | ||
| if self.is_list_type(value): | ||
| assert issubclass( | ||
| value.__args__[0], BaseModel | ||
| ), "invalid `pydantic.BaseModel`" | ||
| self.code_models[key] = value.__args__[0] | ||
| else: | ||
| assert issubclass( | ||
| value, BaseModel | ||
| ), "invalid `pydantic.BaseModel`" | ||
| self.code_models[key] = value |
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.
Add handling for list types, following pattern from source repository.
| elif issubclass(request_body, BaseModel): | ||
| result = Request(request_body).generate_spec() | ||
| else: | ||
| result = {} | ||
| try: | ||
| if issubclass(request_body, BaseModel): | ||
| result = Request(request_body).generate_spec() | ||
| else: | ||
| result = {} | ||
| except TypeError: | ||
| # request_body is not a class (e.g., generic type) | ||
| result = {} |
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.
Add defensive handling for generic types, following source repository logic
| openapi-spec-validator>=0.2.9, <0.3 | ||
| pytest==7.1.2 | ||
| flake8>=4.0.1, <5 | ||
| flask==2.2.5 | ||
| werkzeug==2.2.3 | ||
| requests==2.31.0 | ||
| black==22.3.0 | ||
| mypy==0.971 | ||
| openapi-spec-validator == 0.7.1 | ||
| pytest>=8.3.5, <9 | ||
| flake8 == 7.1.1 | ||
| flask>=2.0.2, <3 | ||
| requests>=2.24.0, <3 | ||
| black>=20.8b1 | ||
| mypy==1.10.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.
Updates to match source repository
| from openapi_spec_validator import validate_v3_spec | ||
| from pydantic.v1 import BaseModel, Field, StrictFloat | ||
| from openapi_spec_validator import OpenAPIV30SpecValidator | ||
| from pydantic.v1 import BaseModel, StrictFloat, Field |
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.
Tests updated to handle dependency updates
CharlesLiu02
left a comment
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.
Not familiar with the flask pydantic spec logic changes, but will stamp
Updating the testing dependencies to match source repository. The prior dependencies became stale, causing CI to break. There are some minor updates to application logic, which were done in line with the source repository, but it should not cause any change in behavior.