File tree Expand file tree Collapse file tree
website/docs/codegen/asyncapi Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,60 @@ The command below generates AsyncAPI TypeScript schema types into the `src/event
2222npx 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
You can’t perform that action at this time.
0 commit comments