{"id":2610,"library":"mypy-boto3-schemas","title":"mypy-boto3-schemas","description":"mypy-boto3-schemas provides type annotations for the AWS Schemas service within the boto3 library, enhancing static type checking for Python applications. It is part of the `mypy-boto3` family of projects, generated by `mypy-boto3-builder`. The current version is 1.42.3 and new versions are released frequently to keep pace with boto3 updates and new AWS service features.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hinting","schemas","types","stubs"],"install":[{"cmd":"pip install mypy-boto3-schemas","lang":"bash","label":"Install core package"}],"dependencies":[{"reason":"mypy-boto3-schemas provides type annotations for boto3; boto3 is required at runtime for the type hints to be useful.","package":"boto3","optional":false},{"reason":"This is a stub package for static type checking; mypy is the primary tool used to leverage these annotations.","package":"mypy","optional":true}],"imports":[{"note":"Type definitions (TypeDefs) are found within the `type_defs` submodule of the service-specific `mypy-boto3` package, not directly from `boto3`.","wrong":"from boto3.schemas.type_defs import SchemaSummaryTypeDef","symbol":"SchemaSummaryTypeDef","correct":"from mypy_boto3_schemas.type_defs import SchemaSummaryTypeDef"},{"note":"Client type annotations are found within the `client` submodule of the service-specific `mypy-boto3` package.","wrong":"from boto3.client import SchemasClient","symbol":"SchemasClient","correct":"from mypy_boto3_schemas.client import SchemasClient"}],"quickstart":{"code":"from typing import TYPE_CHECKING\nfrom mypy_boto3_schemas.type_defs import CreateSchemaInputRequestTypeDef\n\nif TYPE_CHECKING:\n    import boto3\n    from mypy_boto3_schemas.client import SchemasClient\n\ndef create_example_schema(client: \"SchemasClient\") -> None:\n    # Example of a TypeDef for schema creation input\n    schema_input: CreateSchemaInputRequestTypeDef = {\n        \"RegistryName\": \"my-registry\",\n        \"SchemaName\": \"my-schema\",\n        \"Content\": \"{\\\"type\\\": \\\"object\\\", \\\"properties\\\": {\\\"foo\\\": {\\\"type\\\": \\\"string\\\"}}}\",\n        \"Type\": \"OpenApi3\", # Or 'JSONSchema', 'WSDL', 'XSD'\n    }\n    \n    print(f\"Attempting to create schema: {schema_input['SchemaName']}\")\n    # In a real application, you would call a boto3 client method here, e.g.:\n    # client.create_schema(**schema_input)\n\n# Example usage (requires boto3 to be installed and configured)\nif __name__ == \"__main__\":\n    # This part would typically interact with a real boto3 client\n    # For demonstration, we'll use a mock if boto3 is not present\n    try:\n        import boto3\n        schemas_client: \"SchemasClient\" = boto3.client(\"schemas\")\n        create_example_schema(schemas_client)\n    except ImportError:\n        print(\"boto3 not installed. Skipping live client example, but type hints are still valid.\")\n\n","lang":"python","description":"Demonstrates how to import and use a TypeDef for the AWS Schemas service. It includes a `TYPE_CHECKING` block to guard against runtime dependencies on the stub package for production environments, which is a common pattern for `mypy-boto3` users. It shows how to define a schema input using the `CreateSchemaInputRequestTypeDef`."},"warnings":[{"fix":"Upgrade your project's Python interpreter to 3.9 or newer.","message":"Starting with `mypy-boto3-builder` version 8.12.0 (which generates this package), support for Python 3.8 has been removed. Projects using `mypy-boto3-schemas` must use Python 3.9 or newer.","severity":"breaking","affected_versions":">=8.12.0 (builder), >=1.42.0 (schemas)"},{"fix":"Review and update TypeDef names in your codebase according to the new conventions. Refer to the specific service documentation for exact changes.","message":"In `mypy-boto3-builder` version 8.9.0, there were breaking changes to TypeDef naming conventions. Conflicting TypeDef names had `Extra` moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`), and packed method arguments use shorter names (`CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`).","severity":"breaking","affected_versions":">=8.9.0 (builder)"},{"fix":"Replace imports and usage of `mypy_boto3_sms_voice` with `mypy_boto3_pinpoint_sms_voice` and update your `boto3` client calls accordingly.","message":"The `sms-voice` service was removed in `mypy-boto3-builder` version 8.11.0. If your project uses type hints for `sms-voice`, you should migrate to `pinpoint-sms-voice`.","severity":"deprecated","affected_versions":">=8.11.0 (builder)"},{"fix":"Ensure `boto3` is installed via `pip install boto3`. It is recommended to install `mypy` as well if you intend to perform static type checks.","message":"This package (`mypy-boto3-schemas`) is a stub-only library for static type checking. It does not contain any runtime code. You must have `boto3` (or `aioboto3` for async variants) installed in your environment for your application to run.","severity":"gotcha","affected_versions":"*"},{"fix":"Wrap stub-only imports within a `if TYPE_CHECKING:` block and set runtime types to `object` outside of it to prevent `pylint` errors. This ensures type hints are only active during static analysis.","message":"When using `mypy-boto3` stubs with `pylint`, `pylint` might complain about undefined variables if types are used directly without a `TYPE_CHECKING` guard. This is because `pylint` may not fully understand the stub-only nature of the imports.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}