Skip to content

Commit

Permalink
Enable asyncapi documentation for ook
Browse files Browse the repository at this point in the history
The asyncapi docs are available at /ook/asyncapi and the JSON schema
from /ook/asyncapi.json
  • Loading branch information
jonathansick committed Aug 22, 2024
1 parent 1930f04 commit 28c2f5e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog.d/20240822_185836_jsick_DM_45917.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### New features

- Enable AsyncAPI documentation. Docs are available from the `/ook/asyncapi` endpoint, and the schema is available from `/ook/asyncapi/json`.
2 changes: 1 addition & 1 deletion src/ook/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async def create(
http_client=http_client,
kafka_broker=broker,
kafka_ingest_publisher=broker.publisher(
config.ingest_kafka_topic, title="Ook ingest requests"
config.ingest_kafka_topic, description="Ook ingest requests"
),
algolia_client=algolia_client,
)
Expand Down
4 changes: 3 additions & 1 deletion src/ook/kafkarouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@

kafka_security = BaseSecurity(ssl_context=config.kafka.ssl_context)
kafka_router = KafkaRouter(
config.kafka.bootstrap_servers, security=kafka_security
config.kafka.bootstrap_servers,
security=kafka_security,
schema_url=f"{config.path_prefix}/asyncapi",
)

0 comments on commit 28c2f5e

Please sign in to comment.