chore: restore the TypedDict annotations dropped in the rebuild and keep size nullable in the spliced schema

The rebuilt branch missed the writable-ok annotations on
ImageVariationRequestParams (LIT012) and still needs mutable-ok on the
two OpenAPI fixture dicts (LIT001); the spliced ImageResponse.size also
kept its nullable branch, which the regeneration includes.
This commit is contained in:
OrangerXu 2026-10-14 14:54:54 +08:00
parent 8b09d8dfd6
commit 71b0b2bd4f
3 changed files with 9 additions and 4 deletions

View file

@ -22712,6 +22712,9 @@
"1536x1024"
],
"type": "string"
},
{
"type": "null"
}
],
"title": "Size"

View file

@ -53,7 +53,7 @@ IMAGE_VARIATION_OPTIONAL_FIELD_DEFAULTS: Final = MappingProxyType({"image": None
# ImageVariationRequestParams carries FileTypes (typing.IO[bytes]) which
# pydantic cannot turn into a JSON schema, so the documented JSON body
# schema is spelled out for the shape the multipart form accepts.
_IMAGE_VARIATION_REQUEST_BODY: Final[dict[str, object]] = {
_IMAGE_VARIATION_REQUEST_BODY: Final[dict[str, object]] = { # mutable-ok: OpenAPI JSON fixture, never mutated
"required": True,
"content": {
"application/json": {
@ -71,7 +71,9 @@ _IMAGE_VARIATION_REQUEST_BODY: Final[dict[str, object]] = {
}
},
}
_IMAGE_VARIATION_OPENAPI_EXTRA: Final[dict[str, object]] = {"requestBody": _IMAGE_VARIATION_REQUEST_BODY}
_IMAGE_VARIATION_OPENAPI_EXTRA: Final[dict[str, object]] = { # mutable-ok: handed to FastAPI which copies openapi_extra
"requestBody": _IMAGE_VARIATION_REQUEST_BODY
}
IMAGE_ARRAY_FIELD: Final = "image[]"
MASK_ARRAY_FIELD: Final = "mask[]"

View file

@ -42,5 +42,5 @@ class ImageVariationRequestParams(ImageEditOptionalRequestParams, total=False):
Params here: https://platform.openai.com/docs/api-reference/images/createVariation
"""
image: FileTypes
model: str | None
image: FileTypes # writable-ok: request params mirror ImageEditRequestParams' mutable wire format
model: str | None # writable-ok: request params mirror ImageEditRequestParams' mutable wire format