Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: studio breaking when trying to generate code/document #804

Merged
merged 5 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changeset/lucky-geckos-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
"@asyncapi/studio": patch
---
fix studio breaking when trying to generate code/document
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const TemplateParametersSans: ForwardRefRenderFunction<TemplateParameters
const servers = document?.servers();
const availableServers: string[] = [];
Object.entries(servers || {}).forEach(([serverName, server]) => {
if (supportedProtocols.includes(server.protocol())) availableServers.push(serverName);
if (server.protocol && supportedProtocols.includes(server.protocol())) availableServers.push(serverName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can it be that protocol is not a function? What is it instead? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, based on what I noticed during the iteration, some index of server in server.protocol is returning undefined

});

if (supportedProtocols.length && availableServers.length === 0) {
Expand Down