From 139e914d5377eb04c8fc2e609c85d9fe3133445b Mon Sep 17 00:00:00 2001 From: AayushSaini101 Date: Thu, 4 Jul 2024 17:07:15 +0530 Subject: [PATCH] change format --- .../templates/default/asyncapi.yaml | 33 +++++++++++++++++++ src/commands/new/template.ts | 2 +- test/integration/new/template.test.ts | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 assets/create-template/templates/default/asyncapi.yaml diff --git a/assets/create-template/templates/default/asyncapi.yaml b/assets/create-template/templates/default/asyncapi.yaml new file mode 100644 index 0000000000..5c35f49910 --- /dev/null +++ b/assets/create-template/templates/default/asyncapi.yaml @@ -0,0 +1,33 @@ +asyncapi: 2.6.0 + +info: + title: Temperature Service + version: 1.0.0 + description: This service is in charge of processing all the events related to temperature. + +servers: + dev: + url: test.mosquitto.org + protocol: mqtt + +channels: + temperature/changed: + description: Updates the bedroom temperature in the database when the temperatures drops or goes up. + publish: + operationId: temperatureChange + message: + description: Message that is being sent when the temperature in the bedroom changes. + payload: + type: object + additionalProperties: false + properties: + temperatureId: + type: string +components: + schemas: + temperatureId: + type: object + additionalProperties: false + properties: + temperatureId: + type: string \ No newline at end of file diff --git a/src/commands/new/template.ts b/src/commands/new/template.ts index 1745539d27..e8e32a27b7 100644 --- a/src/commands/new/template.ts +++ b/src/commands/new/template.ts @@ -81,7 +81,7 @@ export default class template extends Command { `Unable to create the project. Please check the following message for further info about the error:\n\n${err}` ); } - this.specFile = await load(`${templateDirectory}/asyncapi.yml`); + this.specFile = await load(`${templateDirectory}/asyncapi.yaml`); this.metricsMetadata.template = flags.template; } } diff --git a/test/integration/new/template.test.ts b/test/integration/new/template.test.ts index cff0630120..88e7438013 100644 --- a/test/integration/new/template.test.ts +++ b/test/integration/new/template.test.ts @@ -10,7 +10,7 @@ const errorMessages = { alreadyExists: (projectName: string) => 'Unable to create the project', }; -describe('new glee', () => { +describe('new template', () => { before(() => { try { testHelper.deleteDummyProjectDirectory();