Skip to main content

Function: getMessageBySchemaPath()

getMessageBySchemaPath(directory): (path, options?) => Promise<Message>

Defined in: messages.ts:24

Returns a message from EventCatalog by a given schema path.

Parameters​

ParameterType
directorystring

Returns​

Function

Parameters​

ParameterType
pathstring
options?{ attachSchema: boolean; }
options.attachSchema?boolean

Returns​

Promise<Message>

Example​

import utils from '@eventcatalog/utils';

const { getMessageBySchemaPath } = utils('/path/to/eventcatalog');

// Get the message by the schema path
const message = await getMessageBySchemaPath('/path/to/eventcatalog/messages/InventoryAdjusted/schema.json');
const message = await getMessageBySchemaPath('/path/to/eventcatalog/messages/InventoryAdjusted/schema.avro');