airtai / faststream

FastStream is a powerful and easy-to-use Python framework for building asynchronous services interacting with event streams such as Apache Kafka, RabbitMQ, NATS and Redis.
https://faststream.airt.ai/latest/
Apache License 2.0
2.52k stars 128 forks source link

Incorrect AsyncAPI docs path on "fastkafka docs serve" command #322

Closed Gerleff closed 1 year ago

Gerleff commented 1 year ago

Hi! Seems like a bug.

Assigned root_path at FastKafka

kafka_app = FastKafka(
    ...
    root_path=(settings.PROJECT.SOURCE_PATH / "service/connectors/queue").resolve(),
    ...
)

Logs on execution "fastkafka docs serve ...":

Done! ✨
Check out your shiny new generated files at ..../src/service/connectors/queue/asyncapi/docs.

Unexpected internal error: [Errno 2] No such file or directory: 'asyncapi/docs/'
sternakt commented 1 year ago

Found the issue, should be easily fixable, the problem is this line in the _cli_docs. It should take the app root path into consideration. https://github.com/airtai/fastkafka/blob/367dc7671a7f05065bdf386c914a0e46a9026d46/fastkafka/_cli_docs.py#L91

This is planned to be fixed in the RC tommorow.

Gerleff commented 1 year ago

Thanks for fix!