Function: getMessageBySchemaPath()
getMessageBySchemaPath(
directory): (path,options?) =>Promise<Message>
Defined in: messages.ts:24
Returns a message from EventCatalog by a given schema path.
Parameters
| Parameter | Type |
|---|---|
directory | string |
Returns
Function
Parameters
| Parameter | Type |
|---|---|
path | string |
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');