Skip to content

GetDiscoveredSchema

Source: src/AWS/Schemas/GetDiscoveredSchema.ts

Runtime binding for schemas:GetDiscoveredSchema.

Infers an OpenAPI 3 or JSONSchema Draft 4 schema from up to 10 sample events — the same inference the schema discoverer applies to live traffic, exposed as an on-demand call. The operation is account-level (it is not scoped to any registry or schema). Provide the implementation with Effect.provide(AWS.Schemas.GetDiscoveredSchemaHttp).

// init — account-level, no resource to bind
const getDiscoveredSchema = yield* AWS.Schemas.GetDiscoveredSchema();
// runtime — events are full AWS event envelopes as JSON strings
const { Content } = yield* getDiscoveredSchema({
Type: "OpenApi3",
Events: [JSON.stringify(sampleEvent)],
});