Skip to content

Commit 92d97dd

Browse files
committed
refactor(asyncapi): simplify channel parameter handling and enforce string type
1 parent c43c946 commit 92d97dd

5 files changed

Lines changed: 20 additions & 25 deletions

File tree

packages/asyncapi-typescript-plugin/src/__snapshots__/no-extra-options.ts.snapshot.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface channels {
2525
lightMeasuredResponse: components["messages"]["lightMeasuredResponse"];
2626
};
2727
parameters: {
28-
streetlightId: components["parameters"]["streetlightId"];
28+
streetlightId: string;
2929
};
3030
servers: [
3131
servers["events-test"],
@@ -39,7 +39,7 @@ export interface channels {
3939
turnOnResponse: components["messages"]["commandResponse"];
4040
};
4141
parameters: {
42-
streetlightId: components["parameters"]["streetlightId"];
42+
streetlightId: string;
4343
};
4444
servers: [
4545
servers["commands-test"],
@@ -53,7 +53,7 @@ export interface channels {
5353
turnOffResponse: components["messages"]["commandResponse"];
5454
};
5555
parameters: {
56-
streetlightId: components["parameters"]["streetlightId"];
56+
streetlightId: string;
5757
};
5858
servers: [
5959
servers["commands-test"],
@@ -67,7 +67,7 @@ export interface channels {
6767
dimLightResponse: components["messages"]["commandResponse"];
6868
};
6969
parameters: {
70-
streetlightId: components["parameters"]["streetlightId"];
70+
streetlightId: string;
7171
};
7272
servers: [
7373
servers["commands-test"],
@@ -403,7 +403,6 @@ export interface components {
403403
parameters: {
404404
/** @description The ID of the streetlight. */
405405
streetlightId: {
406-
description: "The ID of the streetlight.";
407406
location: "$message.payload#/item/id";
408407
};
409408
};

packages/asyncapi-typescript-plugin/src/__snapshots__/with-asyncapi-types-file-name.ts.snapshot.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface channels {
2525
lightMeasuredResponse: components["messages"]["lightMeasuredResponse"];
2626
};
2727
parameters: {
28-
streetlightId: components["parameters"]["streetlightId"];
28+
streetlightId: string;
2929
};
3030
servers: [
3131
servers["events-test"],
@@ -39,7 +39,7 @@ export interface channels {
3939
turnOnResponse: components["messages"]["commandResponse"];
4040
};
4141
parameters: {
42-
streetlightId: components["parameters"]["streetlightId"];
42+
streetlightId: string;
4343
};
4444
servers: [
4545
servers["commands-test"],
@@ -53,7 +53,7 @@ export interface channels {
5353
turnOffResponse: components["messages"]["commandResponse"];
5454
};
5555
parameters: {
56-
streetlightId: components["parameters"]["streetlightId"];
56+
streetlightId: string;
5757
};
5858
servers: [
5959
servers["commands-test"],
@@ -67,7 +67,7 @@ export interface channels {
6767
dimLightResponse: components["messages"]["commandResponse"];
6868
};
6969
parameters: {
70-
streetlightId: components["parameters"]["streetlightId"];
70+
streetlightId: string;
7171
};
7272
servers: [
7373
servers["commands-test"],
@@ -403,7 +403,6 @@ export interface components {
403403
parameters: {
404404
/** @description The ID of the streetlight. */
405405
streetlightId: {
406-
description: "The ID of the streetlight.";
407406
location: "$message.payload#/item/id";
408407
};
409408
};

packages/asyncapi-typescript-plugin/src/__snapshots__/with-enum-values.ts.snapshot.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface channels {
2525
lightMeasuredResponse: components["messages"]["lightMeasuredResponse"];
2626
};
2727
parameters: {
28-
streetlightId: components["parameters"]["streetlightId"];
28+
streetlightId: string;
2929
};
3030
servers: [
3131
servers["events-test"],
@@ -39,7 +39,7 @@ export interface channels {
3939
turnOnResponse: components["messages"]["commandResponse"];
4040
};
4141
parameters: {
42-
streetlightId: components["parameters"]["streetlightId"];
42+
streetlightId: string;
4343
};
4444
servers: [
4545
servers["commands-test"],
@@ -53,7 +53,7 @@ export interface channels {
5353
turnOffResponse: components["messages"]["commandResponse"];
5454
};
5555
parameters: {
56-
streetlightId: components["parameters"]["streetlightId"];
56+
streetlightId: string;
5757
};
5858
servers: [
5959
servers["commands-test"],
@@ -67,7 +67,7 @@ export interface channels {
6767
dimLightResponse: components["messages"]["commandResponse"];
6868
};
6969
parameters: {
70-
streetlightId: components["parameters"]["streetlightId"];
70+
streetlightId: string;
7171
};
7272
servers: [
7373
servers["commands-test"],
@@ -403,7 +403,6 @@ export interface components {
403403
parameters: {
404404
/** @description The ID of the streetlight. */
405405
streetlightId: {
406-
description: "The ID of the streetlight.";
407406
location: "$message.payload#/item/id";
408407
};
409408
};

packages/asyncapi-typescript-plugin/src/__snapshots__/with-enum.ts.snapshot.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface channels {
2525
lightMeasuredResponse: components["messages"]["lightMeasuredResponse"];
2626
};
2727
parameters: {
28-
streetlightId: components["parameters"]["streetlightId"];
28+
streetlightId: string;
2929
};
3030
servers: [
3131
servers["events-test"],
@@ -39,7 +39,7 @@ export interface channels {
3939
turnOnResponse: components["messages"]["commandResponse"];
4040
};
4141
parameters: {
42-
streetlightId: components["parameters"]["streetlightId"];
42+
streetlightId: string;
4343
};
4444
servers: [
4545
servers["commands-test"],
@@ -53,7 +53,7 @@ export interface channels {
5353
turnOffResponse: components["messages"]["commandResponse"];
5454
};
5555
parameters: {
56-
streetlightId: components["parameters"]["streetlightId"];
56+
streetlightId: string;
5757
};
5858
servers: [
5959
servers["commands-test"],
@@ -67,7 +67,7 @@ export interface channels {
6767
dimLightResponse: components["messages"]["commandResponse"];
6868
};
6969
parameters: {
70-
streetlightId: components["parameters"]["streetlightId"];
70+
streetlightId: string;
7171
};
7272
servers: [
7373
servers["commands-test"],
@@ -403,7 +403,6 @@ export interface components {
403403
parameters: {
404404
/** @description The ID of the streetlight. */
405405
streetlightId: {
406-
description: "The ID of the streetlight.";
407406
location: "$message.payload#/item/id";
408407
};
409408
};

packages/asyncapi-typescript-plugin/src/__snapshots__/with-immutable.ts.snapshot.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface channels {
2525
readonly lightMeasuredResponse: components["messages"]["lightMeasuredResponse"];
2626
};
2727
readonly parameters: {
28-
readonly streetlightId: components["parameters"]["streetlightId"];
28+
readonly streetlightId: string;
2929
};
3030
readonly servers: [
3131
servers["events-test"],
@@ -39,7 +39,7 @@ export interface channels {
3939
readonly turnOnResponse: components["messages"]["commandResponse"];
4040
};
4141
readonly parameters: {
42-
readonly streetlightId: components["parameters"]["streetlightId"];
42+
readonly streetlightId: string;
4343
};
4444
readonly servers: [
4545
servers["commands-test"],
@@ -53,7 +53,7 @@ export interface channels {
5353
readonly turnOffResponse: components["messages"]["commandResponse"];
5454
};
5555
readonly parameters: {
56-
readonly streetlightId: components["parameters"]["streetlightId"];
56+
readonly streetlightId: string;
5757
};
5858
readonly servers: [
5959
servers["commands-test"],
@@ -67,7 +67,7 @@ export interface channels {
6767
readonly dimLightResponse: components["messages"]["commandResponse"];
6868
};
6969
readonly parameters: {
70-
readonly streetlightId: components["parameters"]["streetlightId"];
70+
readonly streetlightId: string;
7171
};
7272
readonly servers: [
7373
servers["commands-test"],
@@ -403,7 +403,6 @@ export interface components {
403403
parameters: {
404404
/** @description The ID of the streetlight. */
405405
readonly streetlightId: {
406-
readonly description: "The ID of the streetlight.";
407406
readonly location: "$message.payload#/item/id";
408407
};
409408
};

0 commit comments

Comments
 (0)