Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SchemaFactory<T, S>

Type parameters

  • T

  • S

Hierarchy

Index

Constructors

constructor

  • new SchemaFactory(plain?: Partial<S>, extract?: Extract<keyof S, keyof Common>[]): SchemaFactory

Properties

context

context: Common = <Common>{}

extract

extract: ("name" | "namespace" | "aliases" | "doc" | "default" | "order")[]

plain

plain: S

type

type: T

Methods

aliases

  • aliases(...aliases: string[]): this

array

boolean

bytes

copyWith

  • copyWith(modifyObject: any): this
  • Make copy of current schema with modified values

    Parameters

    • modifyObject: any

    Returns this

default

  • default(def: T): this

doc

  • doc(doc: string): this

double

enum

fixed

float

int

logicalType

  • logicalType(logicalType: Required<BaseAvroSchema>["logicalType"], raw?: undefined | { precision: number; scale?: undefined | number }): this
  • logicalType(logicalType: string, raw?: undefined | object): this
  • logicalType<N>(logicalType: Required<BaseAvroSchema>["logicalType"], raw?: undefined | { precision: number; scale?: undefined | number }): BaseSchema<N, S>
  • logicalType<N>(logicalType: string, raw?: undefined | object): BaseSchema<N, S>

long

map

name

  • name(name: string): this

namespace

  • namespace(namespace: string): this

null

order

  • order(order: "ascending" | "descending" | "ignore"): this

raw

  • raw(plain: {}): this
  • Add custom fields to the schema

    Parameters

    • plain: {}

    Returns this

record

string

union

valueOf

  • valueOf(): S

Generated using TypeDoc