Options
All
  • Public
  • Public/Protected
  • All
Menu

avroschema-definer

Index

Variables

Const A

A: SchemaFactory = new SchemaFactory()

Const avroSchema

avroSchema: "/*** Some description** @variableName NameFromCommentTag*/{"namespace": "namespace","type": "record","name": "someRecord","fields": [{ "name": "field", "aliases": ["first"], "type": { "type": "string", "logicalType": "uuid" }, "doc": "some /* comment in doc */ // field" },{ "name": "arr", "order": "ascending", "type": { "type": "array", "items": "string" }, "doc": "some field" },{ "name": "union", "type": ["string", "null"], "doc": "some union field", "default": "some_string" },{ "name": "fixed", "type": { "type": "fixed", "size": 10, "logicalType": "decimal", "precision": 10, "scale": 10 }, "doc": "some's union field's" },{ "name": "map", "type": { "type": "map", "values": "string" }, "doc": "some union field" },{ "name": "enum", "type": { "type": "enum", "symbols": ["some", "any"], "default": "some" } }]}" = `/*** Some description** @variableName NameFromCommentTag*/{"namespace": "namespace","type": "record","name": "someRecord","fields": [{ "name": "field", "aliases": ["first"], "type": { "type": "string", "logicalType": "uuid" }, "doc": "some /* comment in doc */ // field" },{ "name": "arr", "order": "ascending", "type": { "type": "array", "items": "string" }, "doc": "some field" },{ "name": "union", "type": ["string", "null"], "doc": "some union field", "default": "some_string" },{ "name": "fixed", "type": { "type": "fixed", "size": 10, "logicalType": "decimal", "precision": 10, "scale": 10 }, "doc": "some's union field's" },{ "name": "map", "type": { "type": "map", "values": "string" }, "doc": "some union field" },{ "name": "enum", "type": { "type": "enum", "symbols": ["some", "any"], "default": "some" } }]}`

Const defaultTemplate

defaultTemplate: "import A from 'avroschema-definer'<% if (comment.description) { -%>/*** <%= comment.description %>*/<% } -%>const <%= comment.tags ? comment.tags.variableName.name : 'Schema' %> = <%- avscToDefinerCode(schema) %>export default <%= comment.tags ? comment.tags.variableName.name : 'Schema' %>" = `import A from 'avroschema-definer'<% if (comment.description) { -%>/*** <%= comment.description %>*/<% } -%>const <%= comment.tags ? comment.tags.variableName.name : 'Schema' %> = <%- avscToDefinerCode(schema) %>export default <%= comment.tags ? comment.tags.variableName.name : 'Schema' %>`

Functions

Const avscToDefinerCode

composeJSDoc

escapeJsComment

  • escapeJsComment(value: string): string

Const parseSchema

Const pick

  • pick<T>(obj: T): (Anonymous function)
  • Type parameters

    • T: {}

    Parameters

    • obj: T

    Returns (Anonymous function)

Object literals

Const defaultLogicalTypesMapping

defaultLogicalTypesMapping: object

date

date: string = "<Date>"

decimal

decimal: string = "<number>"

timestamp-millis

timestamp-millis: string = "<Date>"

Generated using TypeDoc