Skip to content

Conversation

@jakeane
Copy link
Collaborator

@jakeane jakeane commented Sep 8, 2025

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.

@jakeane jakeane force-pushed the jackkeane/update-static-test-versions branch from 5560e4a to e2efd31 Compare September 8, 2025 23:51
Copy link
Collaborator Author

@jakeane jakeane left a 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

Comment on lines -50 to +59
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
Copy link
Collaborator Author

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.

Comment on lines -53 to +61
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 = {}
Copy link
Collaborator Author

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

Comment on lines -2 to +8
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
Copy link
Collaborator Author

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

Comment on lines -7 to +8
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
Copy link
Collaborator Author

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

@jakeane jakeane changed the title Update python versions for static test Update testing dependencies Sep 9, 2025
Copy link

@CharlesLiu02 CharlesLiu02 left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants