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

Bug: documentation schema hosting returns blank page #1802

Open
yann-combarnous opened this issue Sep 19, 2024 · 5 comments
Open

Bug: documentation schema hosting returns blank page #1802

yann-combarnous opened this issue Sep 19, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@yann-combarnous
Copy link

Describe the bug
Following the tutorial for the AsyncAPI documentation generation, generation works, but hosting with FastStream returns a blank page.

How to reproduce
Here is the generated HTML by FastStream:

   <!DOCTYPE html>
   <html>
   <head>
    
   <title>FastStream AsyncAPI</title>
    
   <link rel="icon" href="https://www.asyncapi.com/favicon.ico">
   <link rel="icon" type="image/png" sizes="16x16" href="https://www.asyncapi.com/favicon-16x16.png">
   <link rel="icon" type="image/png" sizes="32x32" href="https://www.asyncapi.com/favicon-32x32.png">
   <link rel="icon" type="image/png" sizes="194x194" href="https://www.asyncapi.com/favicon-194x194.png">
    
   <link rel="stylesheet" href="https://unpkg.com/@asyncapi/[email protected]/styles/default.min.css">
    
   </head>
    
   <style>
   html {
   font-family: ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sns,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;
   line-height: 1.5;
   }
   </style>
    
   <body>
   <div id="asyncapi"></div>
    
   <script src="https://unpkg.com/@asyncapi/[email protected]/browser/standalone/index.js"></script>
   <script>
    
   AsyncApiStandalone.render({"schema": "{\"asyncapi\":\"2.6.0\",\"defaultContentType\":\"application/json\",\"info\":{\"title\":\"FastStream\",\"version\":\"0.1.0\",\"description\":\"\"},\"servers\":{\"development\":{\"url\":\"xyz.confluent.cloud:9092\",\"protocol\":\"kafka-secure\",\"protocolVersion\":\"auto\",\"security\":[{\"oauthbearer\":[]}]}},\"channels\":{\"topic1:Subscriber\":{\"servers\":[\"development\"],\"bindings\":{\"kafka\":{\"topic\":\"topic1\",\"bindingVersion\":\"0.4.0\"}},\"subscribe\":{\"message\":{\"$ref\":\"#/components/messages/topic1:Subscriber:Message\"}}}},\"components\":{\"messages\":{\"topic1:Subscriber:Message\":{\"title\":\"topic1:Subscriber:Message\",\"correlationId\":{\"location\":\"$message.header#/correlation_id\"},\"payload\":{\"$ref\":\"#/components/schemas/Subscriber:Message:Payload\"}}},\"schemas\":{\"Subscriber:Message:Payload\":{\"title\":\"Subscriber:Message:Payload\"}},\"securitySchemes\":{\"oauthbearer\":{\"type\":\"oauthBearer\"}}}}", "config": {"show": {"sidebar": true, "info": true, "servers": true, "operations": true, "messages": true, "schemas": true, "errors": true}, "expand": {"messageExamples": true}, "sidebar": {"showServers": "byDefault", "showOperations": "byDefault"}}}, document.getElementById('asyncapi'));
    
   </script>
   </body>
   </html>
from faststream import FastStream
...

And/Or steps to reproduce the behavior:

  1. ...

Expected behavior
Documentation display asyncAPI doc

Observed behavior
Browser returns blank page, no error.

Screenshots
N/A

Environment
Running FastStream 0.5.23 with CPython 3.12.4 on Darwin

Additional context
N/A

@yann-combarnous yann-combarnous added the bug Something isn't working label Sep 19, 2024
@Lancetnik
Copy link
Member

@yann-combarnous can you check generated schema by this tool?

https://studio.asyncapi.com/

Probably, it just not correct

@Lancetnik
Copy link
Member

Seems like the problem in ouath bearer schema

@Lancetnik
Copy link
Member

oauthBearer is an invalid type, we have to refactor this place

@Lancetnik Lancetnik mentioned this issue Sep 20, 2024
9 tasks
@KrySeyt
Copy link
Contributor

KrySeyt commented Sep 20, 2024

It will be nice if there is not an empty page, but a description of the error - asyncapi/asyncapi-react#1048

@yann-combarnous
Copy link
Author

yann-combarnous commented Sep 20, 2024

oauthBearer is an invalid type, we have to refactor this place

Indeed, this is where the issue is, even though my code is valid.

For reference if it helps, here is my working code:

from faststream.confluent import KafkaBroker
from faststream.security import SASLOAuthBearer

broker = KafkaBroker(
            f"{kafka_creds['bootstrap_server_url']}:9092",
            config=kafka_creds["read_config"],
            security=SASLOAuthBearer(use_ssl=True),
        )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants