Skip to content

Commit

Permalink
Model & View update (#181)
Browse files Browse the repository at this point in the history
* catalog definition update

* protobuf record name update to reflect java class naming

---------

Co-authored-by: AJ <[email protected]>
  • Loading branch information
ankitk-me and vordimous authored Feb 1, 2024
1 parent 563bce1 commit d25d70c
Show file tree
Hide file tree
Showing 8 changed files with 370 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/.vuepress/sidebar/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export const enSidebar = sidebar({
link: "catalogs/",
children: "structure",
},
{
text: "Models",
prefix: "models/",
link: "models/",
children: "structure",
},
{
text: "Telemetry",
prefix: "telemetry/",
Expand Down Expand Up @@ -261,6 +267,8 @@ export const enSidebar = sidebar({
"config/guards/",
"config/vaults/",
"config/telemetry/",
"config/catalogs/",
"config/models/",
"troubleshooting/aws.md",
],
},
Expand Down
14 changes: 14 additions & 0 deletions src/reference/config/bindings/binding-kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ Conditional routes based on `kafka` `topic` names are used to route these networ
- [options.topics](#options-topics)
- [topics\[\].name\*](#topics-name)
- [topics\[\].defaultOffset](#topics-defaultoffset)
- [topics\[\].key](#topics-key)
- [topics\[\].value](#topics-value)
- [options.servers](#options-servers)
- [options.sasl](#options-sasl)
- [sasl.name](#sasl-name)
Expand Down Expand Up @@ -131,6 +133,18 @@ Topic name.

Fetch offset to use for new consumers

#### topics[].key

> `object` of a named [`model`](../models/)

Enforce validation for key

#### topics[].value

> `object` of a named [`model`](../models/)

Enforce validation for value

### options.servers

> `array` of `string`
Expand Down
91 changes: 91 additions & 0 deletions src/reference/config/models/model-avro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
shortTitle: avro
description: Zilla runtime avro model
category:
- Models
---

# avro model

::: info Feature Coming Soon <HopeIcon icon="fas fa-circle-right"/>
This is currently on the [Zilla roadmap](https://github.com/orgs/aklivity/projects/4). Star and watch the [Zilla repo](https://github.com/aklivity/zilla/releases) for new releases!
:::

Zilla runtime avro model

```yaml {1}
model: avro
view: json
catalog:
items-catalog:
- strategy: topic
version: latest
- subject: items-snapshots
version: latest
- id: 1
```
## Summary
Defines a model to utilize schema from catalog to enforce validation, ensuring adherence to predefined data structures.
## Configuration
:::: note Properties
- [view](#view)
- [catalog\*](#catalog)
- [catalog.strategy](#catalog-strategy)
- [catalog.subject](#catalog-subject)
- [catalog.version](#catalog-version)
- [catalog.id](#catalog-id)
::: right
\* required
:::
::::
### view
> `enum` [ "json" ]

Transforms the model from this data type to the Avro schema on produce and to this data type from the Avro schema on consume.

### catalog\*

> `object`

To map defined catalog for schema retrieval based on catalog specific parameters. Any of the possible combination can be configured.

> `id`
-----
> `strategy`
> `version`
-----
> `subject`
> `version`

#### catalog.strategy

> `enum` [ "topic" ]

To determine the subject based on the specified strategy

#### catalog.subject

> `string`

Unique identifier for schema categorization in the catalog.

#### catalog.version

> `string` | Default: `"latest"`

Specific iteration or version of a registered schema in the defined catalog.

#### catalog.id

> `integer`

Define specific schema id to refer from catalog.
22 changes: 22 additions & 0 deletions src/reference/config/models/model-integer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
shortTitle: integer
description: Zilla runtime integer model
category:
- Models
---

# integer Model

::: info Feature Coming Soon <HopeIcon icon="fas fa-circle-right"/>
This is currently on the [Zilla roadmap](https://github.com/orgs/aklivity/projects/4). Star and watch the [Zilla repo](https://github.com/aklivity/zilla/releases) for new releases!
:::

Zilla runtime integer model

```yaml {1}
model: integer
```
## Summary
Defines a model to enforce validation for integer data.
83 changes: 83 additions & 0 deletions src/reference/config/models/model-json.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
shortTitle: json
description: Zilla runtime json model
category:
- Models
---

# json Model

::: info Feature Coming Soon <HopeIcon icon="fas fa-circle-right"/>
This is currently on the [Zilla roadmap](https://github.com/orgs/aklivity/projects/4). Star and watch the [Zilla repo](https://github.com/aklivity/zilla/releases) for new releases!
:::

Zilla runtime json model

```yaml {1}
model: json
catalog:
items-catalog:
- strategy: topic
version: latest
- subject: items-snapshots
version: latest
- id: 1
```
## Summary
Defines a model to utilize schema from catalog to enforce validation, ensuring adherence to predefined data structures.
## Configuration
:::: note Properties
- [catalog\*](#catalog)
- [catalog.strategy](#catalog-strategy)
- [catalog.subject](#catalog-subject)
- [catalog.version](#catalog-version)
- [catalog.id](#catalog-id)
::: right
\* required
:::
::::
### catalog\*
> `object`

To map defined catalog for schema retrieval based on catalog specific parameters. Any of the possible combination can be configured.

> `id`
-----
> `strategy`
> `version`
-----
> `subject`
> `version`

#### catalog.strategy

> `enum` [ "topic" ]

To determine the subject based on the specified strategy

#### catalog.subject

> `string`

Unique identifier for schema categorization in the catalog.

#### catalog.version

> `string` | Default: `"latest"`

Specific iteration or version of a registered schema in the defined catalog.

#### catalog.id

> `integer`

Define specific schema id to refer from catalog.
104 changes: 104 additions & 0 deletions src/reference/config/models/model-protobuf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
shortTitle: protobuf
description: Zilla runtime protobuf model
category:
- Models
---

# protobuf Model

::: info Feature Coming Soon <HopeIcon icon="fas fa-circle-right"/>
This is currently on the [Zilla roadmap](https://github.com/orgs/aklivity/projects/4). Star and watch the [Zilla repo](https://github.com/aklivity/zilla/releases) for new releases!
:::

Zilla runtime protobuf model

```yaml {1}
model: protobuf
view: json
catalog:
items-catalog:
- strategy: topic
version: latest
record: EchoMessage
- subject: items-snapshots
version: latest
record: EchoMessage
- id: 1
record: EchoMessage
```
## Summary
Defines a model to utilize schema from catalog to enforce validation, ensuring adherence to predefined data structures.
## Configuration
:::: note Properties
- [view](#view)
- [catalog\*](#catalog)
- [catalog.strategy](#catalog-strategy)
- [catalog.subject](#catalog-subject)
- [catalog.version](#catalog-version)
- [catalog.id](#catalog-id)
- [catalog.record\*](#catalog-record)
::: right
\* required
:::
::::
### view
> `enum` [ "json" ]

Transforms the model from this data type to the Protobuf schema on produce and to this data type from the Protobuf schema on consume.

### catalog\*

> `object`

To map defined catalog for schema retrieval based on catalog specific parameters. Any of the possible combination can be configured.

> `id`
> `record`
-----
> `strategy`
> `version`
> `record`
-----
> `subject`
> `version`
> `record`

#### catalog.strategy

> `enum` [ "topic" ]

To determine the subject based on the specified strategy

#### catalog.subject

> `string`

Unique identifier for schema categorization in the catalog.

#### catalog.version

> `string` | Default: `"latest"`

Specific iteration or version of a registered schema in the defined catalog.

#### catalog.id

> `integer`

Define specific schema id to refer from catalog.

#### catalog.record\*

> `string`

Define specific record to refer from Protobuf schema.
41 changes: 41 additions & 0 deletions src/reference/config/models/model-string.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
shortTitle: string
description: Zilla runtime string model
category:
- Models
---

# string Model

::: info Feature Coming Soon <HopeIcon icon="fas fa-circle-right"/>
This is currently on the [Zilla roadmap](https://github.com/orgs/aklivity/projects/4). Star and watch the [Zilla repo](https://github.com/aklivity/zilla/releases) for new releases!
:::

Zilla runtime string model

```yaml {1}
model: string
encoding: utf_8
```
## Summary
Defines a model to enforce validation for string data.
## Configuration
:::: note Properties
- [encoding\*](#encoding)
::: right
\* required
:::
::::
### encoding\*
> `string`

Define character encoding for unicode.
Loading

0 comments on commit d25d70c

Please sign in to comment.