InlineApiSchema

class aws_cdk.aws_bedrock_agentcore_alpha.InlineApiSchema(schema)

Bases: ApiSchema

(experimental) Class to define an API Schema from an inline string.

The schema can be provided directly as a string. Validation is performed at the target configuration level where the schema type is known.

Stability:

experimental

ExampleMetadata:

fixture=default infused

Example:

inline_schema = agentcore.ApiSchema.from_inline("""
    openapi: 3.0.3
    info:
      title: Library API
      version: 1.0.0
    paths:
      /search:
        get:
          summary: Search for books
          operationId: searchBooks
          parameters:
            - name: query
              in: query
              required: true
              schema:
                type: string
    """)
Parameters:

schema (str)

Stability:

experimental

Methods

bind(scope)

(experimental) Bind the schema to a construct.

Parameters:

scope (Construct)

Stability:

experimental

Return type:

None

grant_permissions_to_role(_role)

(experimental) Grant permissions to the role.

Parameters:

_role (IRole)

Stability:

experimental

Return type:

None

Attributes

bucket_owner_account_id

(experimental) The account ID of the S3 bucket owner for cross-account access.

Stability:

experimental

inline_schema

(experimental) The inline OpenAPI schema definition as a string, if using an inline schema.

Can be in JSON or YAML format.

Stability:

experimental

s3_file

(experimental) The S3 location of the API schema file, if using an S3-based schema.

Contains the bucket name and object key information.

Stability:

experimental

Static Methods

classmethod from_inline(schema)

(experimental) Creates an API Schema from an inline string.

Parameters:

schema (str) –

  • the JSON or YAML payload defining the schema (OpenAPI or Smithy).

Stability:

experimental

Return type:

InlineApiSchema

classmethod from_local_asset(path)

(experimental) Creates an API Schema from a local file.

Parameters:

path (str) –

  • the path to the local file containing the OpenAPI schema for the action group.

Stability:

experimental

Return type:

AssetApiSchema

classmethod from_s3_file(bucket, object_key, bucket_owner_account_id=None)

(experimental) Creates an API Schema from an S3 File.

Parameters:
  • bucket (IBucket) –

    • the bucket containing the local file containing the OpenAPI schema for the action group.

  • object_key (str) –

    • object key in the bucket.

  • bucket_owner_account_id (Optional[str]) –

    • optional The account ID of the Amazon S3 bucket owner. This ID is used for cross-account access to the bucket.

Stability:

experimental

Return type:

S3ApiSchema