KafkaModelGenerator 1.1.6
dotnet tool install --global KafkaModelGenerator --version 1.1.6
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
dotnet tool install --local KafkaModelGenerator --version 1.1.6
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=KafkaModelGenerator&version=1.1.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package KafkaModelGenerator --version 1.1.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Kafka Topic Model Generator
A tool that parses Kafka topic schemas and generates C# POCO models that can be used with Confluent's SDK to publish and subscribe to topics.
Main functionalities
- Parses Kafka topic schemas. Supported formats:
jsonavro
- Outputs C# POCO models tailored to work with Confluent's .Net SDK serializers
- Outputs the Kafka topic schemas, used as inputs with any necessary adjustments to work with the generated models
Installing the tool
# Install as a global tool: Makes the tool available system-wide (in your PATH)
dotnet tool install -g KafkaModelGenerator
# Install a specific version, as a global tool
dotnet tool install -g KafkaModelGenerator --version <VERSION>
---
# Install as a local tool: Installs into .config/dotnet-tools.json
dotnet new tool-manifest # only once per repo
dotnet tool install KafkaModelGenerator
# Install a specific version, as a local tool
dotnet tool install KafkaModelGenerator --version <VERSION>
Using the tool
Usage:
kafka-model-generator --schema-content "<schema-content>" --schema-type "<schema-type>" --output-dir "<output-directory>" [--namespace "<namespace>"] [--root-class-name "<root-class-name>"]
kafka-model-generator --schema-file "<schema-file-path>" --schema-type "<schema-type>" --output-dir "<output-directory>" [--namespace "<namespace>"] [--root-class-name "<root-class-name>"]
Examples:
kafka-model-generator --schema-content "{ \"title\": \"OrderCreated\", \"type\": \"object\", \"properties\": { \"id\": { \"type\": \"string\" } }, \"required\": [\"id\"] }" --schema-type "json" --output-dir "./Generated"
kafka-model-generator --schema-file "./schemas/order-created.json" --schema-type "json" --output-dir "./Generated" --namespace "MyCompany.Kafka.Models"
Notes:
--schema-content Full schema content as a string
--schema-file Path to a file containing the JSON schema
--schema-type One of the supported schema types. Accepts: json
--output-dir Directory where generated files will be written
--namespace Optional. Default: Generated.Kafka.Models
--root-class-name Optional. Overrides the generated root class name
--help Show help
Notes
- 1 and only 1 of
--schema-contentand--schema-filemust be provided - The tool will generate 2 files in the provided
--output-dir:- 1 file with the C# POCOs
- 1 file with the normalized schema, with potential necessary adjustments to make it work with Confluent's .Net SDK
- Confluent's .Net SDK expects the schema's title to match the C# class name. The tool will follow this priority when de termining the generated C# class name:
--root-class-name, if provided- The schema's
title(for JSON) orname(for AVRO) property, if present - The default value: KafkaMessage
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.