Skip to content

Commit 388ceae

Browse files
authored
feat: refactor the http protocol (#301)
1 parent a337d4b commit 388ceae

31 files changed

Lines changed: 8902 additions & 3986 deletions

docs/protocols/http_client.md

Lines changed: 476 additions & 14 deletions
Large diffs are not rendered by default.

src/codegen/generators/typescript/channels/asyncapi.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ import {generateKafkaChannels} from './protocols/kafka';
2323
import {generateMqttChannels} from './protocols/mqtt';
2424
import {generateAmqpChannels} from './protocols/amqp';
2525
import {generateEventSourceChannels} from './protocols/eventsource';
26-
import {generatehttpChannels} from './protocols/http';
26+
import {
27+
generatehttpChannels,
28+
resetHttpCommonTypesState
29+
} from './protocols/http';
2730
import {generateWebSocketChannels} from './protocols/websocket';
2831

2932
type Action = 'send' | 'receive' | 'subscribe' | 'publish';
@@ -85,6 +88,11 @@ export async function generateTypeScriptChannelsForAsyncAPI(
8588
>,
8689
protocolDependencies: Record<string, string[]>
8790
): Promise<void> {
91+
// Reset protocol-specific state at the start of each generation cycle
92+
if (protocolsToUse.includes('http_client')) {
93+
resetHttpCommonTypesState();
94+
}
95+
8896
const {asyncapiDocument} = validateAsyncapiContext(context);
8997
const channels = asyncapiDocument!
9098
.allChannels()

0 commit comments

Comments
 (0)