Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#1172)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 10, 2024
1 parent 06a3d17 commit 2e661f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1254
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f1e9ce89f54c7135fad4459c99779782e4acdc4a34ca20508d56546e0aee7ba0.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2af682297dfff56c3d58057ef1b2971523567c75f9a625f364efb37cefa3fa81.yml
8 changes: 8 additions & 0 deletions src/cloudflare/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,14 @@ def validate_type(*, type_: type[_T], value: object) -> _T:
return cast(_T, _validate_non_model_type(type_=type_, value=value))


def set_pydantic_config(typ: Any, config: pydantic.ConfigDict) -> None:
"""Add a pydantic config for the given type.
Note: this is a no-op on Pydantic v1.
"""
setattr(typ, "__pydantic_config__", config) # noqa: B010


# our use of subclasssing here causes weirdness for type checkers,
# so we just pretend that we don't subclass
if TYPE_CHECKING:
Expand Down

0 comments on commit 2e661f0

Please sign in to comment.