Skip to content

Commit 53e594a

Browse files
committed
refactor(asyncapi): update streetlightId parameter to use enum values
1 parent 454beb0 commit 53e594a

5 files changed

Lines changed: 60 additions & 25 deletions

File tree

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

Lines changed: 12 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: string;
28+
streetlightId: "streetlight-1" | "streetlight-2";
2929
};
3030
servers: [
3131
servers["events-test"],
@@ -39,7 +39,7 @@ export interface channels {
3939
turnOnResponse: components["messages"]["commandResponse"];
4040
};
4141
parameters: {
42-
streetlightId: string;
42+
streetlightId: "streetlight-1" | "streetlight-2";
4343
};
4444
servers: [
4545
servers["commands-test"],
@@ -53,7 +53,7 @@ export interface channels {
5353
turnOffResponse: components["messages"]["commandResponse"];
5454
};
5555
parameters: {
56-
streetlightId: string;
56+
streetlightId: "streetlight-1" | "streetlight-2";
5757
};
5858
servers: [
5959
servers["commands-test"],
@@ -67,7 +67,7 @@ export interface channels {
6767
dimLightResponse: components["messages"]["commandResponse"];
6868
};
6969
parameters: {
70-
streetlightId: string;
70+
streetlightId: "streetlight-1" | "streetlight-2";
7171
};
7272
servers: [
7373
servers["commands-test"],
@@ -401,9 +401,16 @@ export interface components {
401401
};
402402
};
403403
parameters: {
404-
/** @description The ID of the streetlight. */
404+
/**
405+
* @description The ID of the streetlight.
406+
* @enum {unknown}
407+
*/
405408
streetlightId: {
406409
location: "$message.payload#/item/id";
410+
enum: [
411+
"streetlight-1",
412+
"streetlight-2"
413+
];
407414
};
408415
};
409416
securitySchemes: {

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

Lines changed: 12 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: string;
28+
streetlightId: "streetlight-1" | "streetlight-2";
2929
};
3030
servers: [
3131
servers["events-test"],
@@ -39,7 +39,7 @@ export interface channels {
3939
turnOnResponse: components["messages"]["commandResponse"];
4040
};
4141
parameters: {
42-
streetlightId: string;
42+
streetlightId: "streetlight-1" | "streetlight-2";
4343
};
4444
servers: [
4545
servers["commands-test"],
@@ -53,7 +53,7 @@ export interface channels {
5353
turnOffResponse: components["messages"]["commandResponse"];
5454
};
5555
parameters: {
56-
streetlightId: string;
56+
streetlightId: "streetlight-1" | "streetlight-2";
5757
};
5858
servers: [
5959
servers["commands-test"],
@@ -67,7 +67,7 @@ export interface channels {
6767
dimLightResponse: components["messages"]["commandResponse"];
6868
};
6969
parameters: {
70-
streetlightId: string;
70+
streetlightId: "streetlight-1" | "streetlight-2";
7171
};
7272
servers: [
7373
servers["commands-test"],
@@ -401,9 +401,16 @@ export interface components {
401401
};
402402
};
403403
parameters: {
404-
/** @description The ID of the streetlight. */
404+
/**
405+
* @description The ID of the streetlight.
406+
* @enum {unknown}
407+
*/
405408
streetlightId: {
406409
location: "$message.payload#/item/id";
410+
enum: [
411+
"streetlight-1",
412+
"streetlight-2"
413+
];
407414
};
408415
};
409416
securitySchemes: {

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

Lines changed: 12 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: string;
28+
streetlightId: "streetlight-1" | "streetlight-2";
2929
};
3030
servers: [
3131
servers["events-test"],
@@ -39,7 +39,7 @@ export interface channels {
3939
turnOnResponse: components["messages"]["commandResponse"];
4040
};
4141
parameters: {
42-
streetlightId: string;
42+
streetlightId: "streetlight-1" | "streetlight-2";
4343
};
4444
servers: [
4545
servers["commands-test"],
@@ -53,7 +53,7 @@ export interface channels {
5353
turnOffResponse: components["messages"]["commandResponse"];
5454
};
5555
parameters: {
56-
streetlightId: string;
56+
streetlightId: "streetlight-1" | "streetlight-2";
5757
};
5858
servers: [
5959
servers["commands-test"],
@@ -67,7 +67,7 @@ export interface channels {
6767
dimLightResponse: components["messages"]["commandResponse"];
6868
};
6969
parameters: {
70-
streetlightId: string;
70+
streetlightId: "streetlight-1" | "streetlight-2";
7171
};
7272
servers: [
7373
servers["commands-test"],
@@ -401,9 +401,16 @@ export interface components {
401401
};
402402
};
403403
parameters: {
404-
/** @description The ID of the streetlight. */
404+
/**
405+
* @description The ID of the streetlight.
406+
* @enum {unknown}
407+
*/
405408
streetlightId: {
406409
location: "$message.payload#/item/id";
410+
enum: [
411+
"streetlight-1",
412+
"streetlight-2"
413+
];
407414
};
408415
};
409416
securitySchemes: {

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

Lines changed: 12 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: string;
28+
streetlightId: "streetlight-1" | "streetlight-2";
2929
};
3030
servers: [
3131
servers["events-test"],
@@ -39,7 +39,7 @@ export interface channels {
3939
turnOnResponse: components["messages"]["commandResponse"];
4040
};
4141
parameters: {
42-
streetlightId: string;
42+
streetlightId: "streetlight-1" | "streetlight-2";
4343
};
4444
servers: [
4545
servers["commands-test"],
@@ -53,7 +53,7 @@ export interface channels {
5353
turnOffResponse: components["messages"]["commandResponse"];
5454
};
5555
parameters: {
56-
streetlightId: string;
56+
streetlightId: "streetlight-1" | "streetlight-2";
5757
};
5858
servers: [
5959
servers["commands-test"],
@@ -67,7 +67,7 @@ export interface channels {
6767
dimLightResponse: components["messages"]["commandResponse"];
6868
};
6969
parameters: {
70-
streetlightId: string;
70+
streetlightId: "streetlight-1" | "streetlight-2";
7171
};
7272
servers: [
7373
servers["commands-test"],
@@ -401,9 +401,16 @@ export interface components {
401401
};
402402
};
403403
parameters: {
404-
/** @description The ID of the streetlight. */
404+
/**
405+
* @description The ID of the streetlight.
406+
* @enum {unknown}
407+
*/
405408
streetlightId: {
406409
location: "$message.payload#/item/id";
410+
enum: [
411+
"streetlight-1",
412+
"streetlight-2"
413+
];
407414
};
408415
};
409416
securitySchemes: {

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

Lines changed: 12 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: string;
28+
readonly streetlightId: "streetlight-1" | "streetlight-2";
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: string;
42+
readonly streetlightId: "streetlight-1" | "streetlight-2";
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: string;
56+
readonly streetlightId: "streetlight-1" | "streetlight-2";
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: string;
70+
readonly streetlightId: "streetlight-1" | "streetlight-2";
7171
};
7272
readonly servers: [
7373
servers["commands-test"],
@@ -401,9 +401,16 @@ export interface components {
401401
};
402402
};
403403
parameters: {
404-
/** @description The ID of the streetlight. */
404+
/**
405+
* @description The ID of the streetlight.
406+
* @enum {unknown}
407+
*/
405408
readonly streetlightId: {
406409
readonly location: "$message.payload#/item/id";
410+
readonly enum: [
411+
"streetlight-1",
412+
"streetlight-2"
413+
];
407414
};
408415
};
409416
securitySchemes: {

0 commit comments

Comments
 (0)