Interface IJsonSchemaGenerator

Namespace
Cratis.Chronicle.Schemas
Assembly
Cratis.Chronicle.dll

Defines a generator that can generate JsonSchema.

public interface IJsonSchemaGenerator
Extension Methods

Methods

Generate(Type)

Generate a JsonSchema for a specific type.

JsonSchema Generate(Type type)

Parameters

type Type

Type to generate for.

Returns

JsonSchema

A generated JsonSchema.

Generate(Type, IEventTypes)

Generates a precise event schema using the owning store's event identities.

JsonSchema Generate(Type type, IEventTypes eventTypes)

Parameters

type Type

The event type.

eventTypes IEventTypes

The owning store's finalized event registry.

Returns

JsonSchema

The generated schema.

Exceptions

RegistryAwareEventTypeSchemasNotSupported

The generator does not support a required explicit compensation binding.

GenerateForReadModel(Type)

Generate a JsonSchema for a read model type.

JsonSchema GenerateForReadModel(Type type)

Parameters

type Type

Read model Type to generate for.

Returns

JsonSchema

A generated JsonSchema.

Remarks

Uses the same precise shape as Generate(Type).

GenerateLegacyEventType(Type)

Generates the legacy event schema for a kernel without precise schema support.

JsonSchema GenerateLegacyEventType(Type type)

Parameters

type Type

The event type.

Returns

JsonSchema

The legacy schema.

Exceptions

LegacyEventTypeSchemasNotSupported

The generator does not support legacy event schemas.

GenerateLegacyEventType(Type, IEventTypes)

Generates a legacy event schema using the owning store's event identities.

JsonSchema GenerateLegacyEventType(Type type, IEventTypes eventTypes)

Parameters

type Type

The event type.

eventTypes IEventTypes

The owning store's finalized event registry.

Returns

JsonSchema

The generated legacy schema.

Exceptions

RegistryAwareEventTypeSchemasNotSupported

The generator does not support a required explicit compensation binding.