Skip to content

Commit 9da9ca4

Browse files
committed
docs: add generated output example to CLI documentation for clarity
1 parent d5a9f72 commit 9da9ca4

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

website/docs/codegen/asyncapi/index.mdx

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,60 @@ The command below generates AsyncAPI TypeScript schema types into the `src/event
2222
npx qraft asyncapi --plugin asyncapi-typescript ./asyncapi.yaml --output-dir src/events
2323
```
2424

25+
## Generated output example
26+
27+
Below is a real excerpt of generated code (from plugin snapshots):
28+
29+
```ts
30+
/**
31+
* This file was auto-generated by @qraft/cli.
32+
* Do not make direct changes to the file.
33+
*/
34+
35+
export interface servers {
36+
"events-test": components["servers"]["events-test"];
37+
/** @description Production WebSocket server for events (lighting measurements) secured with TLS */
38+
"events-prod": {
39+
host: "prod-events.example.com";
40+
protocol: "wss";
41+
};
42+
}
43+
44+
export interface channels {
45+
lightingMeasured: {
46+
address: "/events/streetlights/{streetlightId}/lighting/measured";
47+
messages: {
48+
lightMeasured: components["messages"]["lightMeasured"];
49+
lightMeasuredResponse: components["messages"]["lightMeasuredResponse"];
50+
};
51+
parameters: {
52+
streetlightId: "streetlight-1" | "streetlight-2";
53+
};
54+
servers: [
55+
servers["events-test"],
56+
servers["events-prod"]
57+
];
58+
};
59+
}
60+
61+
export interface operations {
62+
receiveLightMeasurement: {
63+
action: "receive";
64+
channel: channels["lightingMeasured"];
65+
messages: [
66+
channels["lightingMeasured"]["messages"]["lightMeasured"]
67+
];
68+
reply: {
69+
channel: channels["lightingMeasured"];
70+
messages: [
71+
channels["lightingMeasured"]["messages"]["lightMeasuredResponse"]
72+
];
73+
};
74+
summary: "Server receives light measurement data from a sensor and responds with acknowledgment.";
75+
};
76+
}
77+
```
78+
2579
## Options
2680

2781
### Required

0 commit comments

Comments
 (0)