@riddix/hamh 2.1.0-alpha.437 → 2.1.0-alpha.438

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -149030,7 +149030,8 @@ function matterApi(bridgeService, haRegistry) {
149030
149030
  const body = req.body;
149031
149031
  const isValid = ajv.validate(createBridgeRequestSchema, body);
149032
149032
  if (!isValid) {
149033
- res.status(400).json(ajv.errors);
149033
+ const details = ajv.errors?.map((e) => `${e.instancePath || "/"}: ${e.message}`).join("; ") ?? "Unknown";
149034
+ res.status(400).json({ error: `Validation failed: ${details}` });
149034
149035
  } else {
149035
149036
  try {
149036
149037
  const bridge = await bridgeService.create(body);
@@ -149071,7 +149072,8 @@ function matterApi(bridgeService, haRegistry) {
149071
149072
  const body = req.body;
149072
149073
  const isValid = ajv.validate(updateBridgeRequestSchema, body);
149073
149074
  if (!isValid) {
149074
- res.status(400).json(ajv.errors);
149075
+ const details = ajv.errors?.map((e) => `${e.instancePath || "/"}: ${e.message}`).join("; ") ?? "Unknown";
149076
+ res.status(400).json({ error: `Validation failed: ${details}` });
149075
149077
  } else if (bridgeId !== body.id) {
149076
149078
  res.status(400).send("Path variable `bridgeId` does not match `body.id`");
149077
149079
  } else {