Skip to content

Commit

Permalink
feat: add channels, tag
Browse files Browse the repository at this point in the history
  • Loading branch information
skonik committed Jul 20, 2024
1 parent bce9e7f commit a1987e6
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 15 deletions.
6 changes: 5 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
.. toctree::
:maxdepth: 2
asyncapi_api/simple_spec
asyncapi_api/v3/simple_spec
asyncapi_api/v3/topic_v3
asyncapi_api/v3/tag
```
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,3 @@ class MySpecialServiceAsyncAPISpecV3(SimpleSpecV3):
Result:

![result](../assets/img/result.png)
test

```{eval-rst}
.. autoattrs:: django_asyncapi.settings.DjangoAsyncapiSettings
:members:
```
52 changes: 52 additions & 0 deletions docs/asyncapi_api/v3/tag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Tag


```{eval-rst}
.. automodule:: asyncapi_container.asyncapi.spec.v3.tag
:members:
```



```python

class Customer(BaseModel):
first_name: str = Field(..., title='First Name')
last_name: str = Field(..., title='Last Name')
email: str = Field(..., title='Email')
country: str = Field(..., title='Country')
zipcode: str = Field(..., title='Zipcode')
city: str = Field(..., title='City')
street: str = Field(..., title='Street')
apartment: str = Field(..., title='Apartment')


class OrderSchemaV1(BaseModel):
product_id: int = Field(..., title='Product Id')
quantity: int = Field(..., title='Quantity')
customer: Customer


class MySpecialServiceAsyncAPISpecV3(SimpleSpecV3):
info: Info = Info(
title="My special Service",
version="1.0.0",
description="Service for making orders"
)
sends: RoutingMap = {}
receives: RoutingMap = {
TopicV3(
address="test.topic.v1",
title="TESTING TITLE",
description="test",
summary="testing summary",
tags=[
Tag(name="test"),
]
): [
Customer
]
}
```
52 changes: 52 additions & 0 deletions docs/asyncapi_api/v3/topic_v3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Channel


```{eval-rst}
.. automodule:: asyncapi_container.containers.v3.simple_channels
:members:
```



```python

class Customer(BaseModel):
first_name: str = Field(..., title='First Name')
last_name: str = Field(..., title='Last Name')
email: str = Field(..., title='Email')
country: str = Field(..., title='Country')
zipcode: str = Field(..., title='Zipcode')
city: str = Field(..., title='City')
street: str = Field(..., title='Street')
apartment: str = Field(..., title='Apartment')


class OrderSchemaV1(BaseModel):
product_id: int = Field(..., title='Product Id')
quantity: int = Field(..., title='Quantity')
customer: Customer


class MySpecialServiceAsyncAPISpecV3(SimpleSpecV3):
info: Info = Info(
title="My special Service",
version="1.0.0",
description="Service for making orders"
)
sends: RoutingMap = {}
receives: RoutingMap = {
TopicV3(
address="test.topic.v1",
title="TESTING TITLE",
description="test",
summary="testing summary",
tags=[
Tag(name="test"),
]
): [
Customer
]
}
```
29 changes: 25 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-asyncapi"
version = "0.1.1"
version = "0.3.0"
description = ""
authors = ["Sergei Konik <s.konik.dev@gmail.com>"]
readme = "README.md"
Expand All @@ -9,8 +9,8 @@ packages = [{include = "django_asyncapi"}]
[tool.poetry.dependencies]
python = "^3.10"
django = ">= 3.2.0"
asyncapi-container = "0.3.1"
attrs = "^23.2.0"
asyncapi-container = "^0.4.0"


[tool.poetry.group.docs.dependencies]
Expand Down

0 comments on commit a1987e6

Please sign in to comment.