diff --git a/src/Saunter/AsyncApiSchema/v2/Bindings/ChannelBindings.cs b/src/Saunter/AsyncApiSchema/v2/Bindings/ChannelBindings.cs
index 5d79e428..57b792ca 100644
--- a/src/Saunter/AsyncApiSchema/v2/Bindings/ChannelBindings.cs
+++ b/src/Saunter/AsyncApiSchema/v2/Bindings/ChannelBindings.cs
@@ -3,6 +3,7 @@
using Saunter.AsyncApiSchema.v2.Bindings.Http;
using Saunter.AsyncApiSchema.v2.Bindings.Kafka;
using Saunter.AsyncApiSchema.v2.Bindings.Mqtt;
+using Saunter.AsyncApiSchema.v2.Bindings.Pulsar;
namespace Saunter.AsyncApiSchema.v2.Bindings
{
@@ -32,5 +33,8 @@ public class ChannelBindings : IChannelBindings
[JsonProperty("mqtt", NullValueHandling = NullValueHandling.Ignore)]
public MqttChannelBinding Mqtt { get; set; }
+
+ [JsonProperty("pulsar", NullValueHandling = NullValueHandling.Ignore)]
+ public PulsarChannelBinding Pulsar { get; set; }
}
}
diff --git a/src/Saunter/AsyncApiSchema/v2/Bindings/MessageBindings.cs b/src/Saunter/AsyncApiSchema/v2/Bindings/MessageBindings.cs
index 130fd8b7..ab4d1037 100644
--- a/src/Saunter/AsyncApiSchema/v2/Bindings/MessageBindings.cs
+++ b/src/Saunter/AsyncApiSchema/v2/Bindings/MessageBindings.cs
@@ -3,6 +3,7 @@
using Saunter.AsyncApiSchema.v2.Bindings.Http;
using Saunter.AsyncApiSchema.v2.Bindings.Kafka;
using Saunter.AsyncApiSchema.v2.Bindings.Mqtt;
+using Saunter.AsyncApiSchema.v2.Bindings.Pulsar;
namespace Saunter.AsyncApiSchema.v2.Bindings
{
@@ -32,5 +33,9 @@ public class MessageBindings : IMessageBindings
[JsonProperty("mqtt", NullValueHandling = NullValueHandling.Ignore)]
public MqttMessageBinding Mqtt { get; set; }
+
+ [JsonProperty("pulsar", NullValueHandling = NullValueHandling.Ignore)]
+ public PulsarMessageBinding Pulsar { get; set; }
+
}
}
diff --git a/src/Saunter/AsyncApiSchema/v2/Bindings/OperationBindings.cs b/src/Saunter/AsyncApiSchema/v2/Bindings/OperationBindings.cs
index 9116d43d..87035f94 100644
--- a/src/Saunter/AsyncApiSchema/v2/Bindings/OperationBindings.cs
+++ b/src/Saunter/AsyncApiSchema/v2/Bindings/OperationBindings.cs
@@ -3,6 +3,7 @@
using Saunter.AsyncApiSchema.v2.Bindings.Http;
using Saunter.AsyncApiSchema.v2.Bindings.Kafka;
using Saunter.AsyncApiSchema.v2.Bindings.Mqtt;
+using Saunter.AsyncApiSchema.v2.Bindings.Pulsar;
namespace Saunter.AsyncApiSchema.v2.Bindings
{
@@ -32,5 +33,8 @@ public class OperationBindings : IOperationBindings
[JsonProperty("mqtt", NullValueHandling = NullValueHandling.Ignore)]
public MqttOperationBinding Mqtt { get; set; }
+
+ [JsonProperty("pulsar", NullValueHandling = NullValueHandling.Ignore)]
+ public PulsarOperationBinding Pulsar { get; set; }
}
}
diff --git a/src/Saunter/AsyncApiSchema/v2/Bindings/Pulsar/PulsarChannelBinding.cs b/src/Saunter/AsyncApiSchema/v2/Bindings/Pulsar/PulsarChannelBinding.cs
new file mode 100644
index 00000000..d46a8c7d
--- /dev/null
+++ b/src/Saunter/AsyncApiSchema/v2/Bindings/Pulsar/PulsarChannelBinding.cs
@@ -0,0 +1,83 @@
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+
+namespace Saunter.AsyncApiSchema.v2.Bindings.Pulsar
+{
+ ///
+ /// See: https://github.com/asyncapi/bindings/tree/master/pulsar#channel-binding-object
+ ///
+ public class PulsarChannelBinding
+ {
+ ///
+ /// The version of this binding. If omitted, "latest" MUST be assumed.
+ ///
+ [JsonProperty("bindingVersion", NullValueHandling = NullValueHandling.Ignore)]
+ public string BindingVersion { get; set; }
+
+ ///
+ /// The namespace associated with the topic.
+ ///
+ [JsonProperty("namespace", NullValueHandling = NullValueHandling.Ignore)]
+ public string Namespace { get; set; }
+
+ ///
+ /// persistence of the topic in Pulsar persistent or non-persistent.
+ ///
+ [JsonProperty("persistence", NullValueHandling = NullValueHandling.Ignore)]
+ public Persistence? Persistence { get; set; }
+
+ ///
+ /// Topic compaction threshold given in bytes.
+ ///
+ [JsonProperty("compaction", NullValueHandling = NullValueHandling.Ignore)]
+ public int? Compaction { get; set; }
+
+ ///
+ /// A list of clusters the topic is replicated to.
+ ///
+ [JsonProperty("geoReplication", NullValueHandling = NullValueHandling.Ignore)]
+ public IList GeoReplication { get; set; }
+
+ ///
+ /// Topic retention policy.
+ ///
+ [JsonProperty("retention", NullValueHandling = NullValueHandling.Ignore)]
+ public RetentionDefinition Retention { get; set; }
+
+ ///
+ /// Message Time-to-live in seconds.
+ ///
+ [JsonProperty("ttl", NullValueHandling = NullValueHandling.Ignore)]
+ public int? TTL { get; set; }
+
+ ///
+ /// When Message deduplication is enabled, it ensures that each message produced on Pulsar topics is persisted to disk only once.
+ ///
+ [JsonProperty("deduplication", NullValueHandling = NullValueHandling.Ignore)]
+ public bool? Deduplication { get; set; }
+ }
+
+ public enum Persistence
+ {
+ [EnumMember(Value = "persistent")]
+ Persistent,
+ [EnumMember(Value = "non-persistent")]
+ NonPersistent,
+ }
+
+ public class RetentionDefinition
+ {
+ ///
+ /// Time given in Minutes. 0 = Disable message retention (by default).
+ ///
+ [JsonProperty("time", NullValueHandling = NullValueHandling.Ignore)]
+ public int Time { get; set; }
+
+ ///
+ /// Size given in MegaBytes. 0 = Disable message retention (by default).
+ ///
+ [JsonProperty("size", NullValueHandling = NullValueHandling.Ignore)]
+ public int Size { get; set; }
+ }
+}
diff --git a/src/Saunter/AsyncApiSchema/v2/Bindings/Pulsar/PulsarMessageBinding.cs b/src/Saunter/AsyncApiSchema/v2/Bindings/Pulsar/PulsarMessageBinding.cs
new file mode 100644
index 00000000..d8342c1d
--- /dev/null
+++ b/src/Saunter/AsyncApiSchema/v2/Bindings/Pulsar/PulsarMessageBinding.cs
@@ -0,0 +1,12 @@
+namespace Saunter.AsyncApiSchema.v2.Bindings.Pulsar
+{
+ ///
+ /// This object MUST NOT contain any properties. Its name is reserved for future use.
+ ///
+ ///
+ /// See: https://github.com/asyncapi/bindings/blob/master/pulsar/README.md#message-binding-object
+ ///
+ public class PulsarMessageBinding
+ {
+ }
+}
diff --git a/src/Saunter/AsyncApiSchema/v2/Bindings/Pulsar/PulsarOperationBinding.cs b/src/Saunter/AsyncApiSchema/v2/Bindings/Pulsar/PulsarOperationBinding.cs
new file mode 100644
index 00000000..48755b70
--- /dev/null
+++ b/src/Saunter/AsyncApiSchema/v2/Bindings/Pulsar/PulsarOperationBinding.cs
@@ -0,0 +1,12 @@
+namespace Saunter.AsyncApiSchema.v2.Bindings.Pulsar
+{
+ ///
+ /// This object MUST NOT contain any properties. Its name is reserved for future use.
+ ///
+ ///
+ /// See: https://github.com/asyncapi/bindings/blob/master/pulsar/README.md#operation-binding-object
+ ///
+ public class PulsarOperationBinding
+ {
+ }
+}
diff --git a/src/Saunter/AsyncApiSchema/v2/Bindings/Pulsar/PulsarServerBinding.cs b/src/Saunter/AsyncApiSchema/v2/Bindings/Pulsar/PulsarServerBinding.cs
new file mode 100644
index 00000000..af7b3c0c
--- /dev/null
+++ b/src/Saunter/AsyncApiSchema/v2/Bindings/Pulsar/PulsarServerBinding.cs
@@ -0,0 +1,16 @@
+using Newtonsoft.Json;
+
+namespace Saunter.AsyncApiSchema.v2.Bindings.Pulsar
+{
+ ///
+ /// See: https://github.com/asyncapi/bindings/tree/master/pulsar#server-binding-object
+ ///
+ public class PulsarServerBinding
+ {
+ ///
+ /// The pulsar tenant. If omitted, "public" must be assumed.
+ ///
+ [JsonProperty("tenant", NullValueHandling = NullValueHandling.Ignore)]
+ public string Tenant { get; set; }
+ }
+}
diff --git a/src/Saunter/AsyncApiSchema/v2/Bindings/Pulsar/README.md b/src/Saunter/AsyncApiSchema/v2/Bindings/Pulsar/README.md
new file mode 100644
index 00000000..263c8573
--- /dev/null
+++ b/src/Saunter/AsyncApiSchema/v2/Bindings/Pulsar/README.md
@@ -0,0 +1 @@
+https://github.com/asyncapi/bindings/blob/master/pulsar/README.md
\ No newline at end of file
diff --git a/src/Saunter/AsyncApiSchema/v2/Bindings/ServerBindings.cs b/src/Saunter/AsyncApiSchema/v2/Bindings/ServerBindings.cs
index 7484fdec..4d5e996b 100644
--- a/src/Saunter/AsyncApiSchema/v2/Bindings/ServerBindings.cs
+++ b/src/Saunter/AsyncApiSchema/v2/Bindings/ServerBindings.cs
@@ -3,6 +3,7 @@
using Saunter.AsyncApiSchema.v2.Bindings.Http;
using Saunter.AsyncApiSchema.v2.Bindings.Kafka;
using Saunter.AsyncApiSchema.v2.Bindings.Mqtt;
+using Saunter.AsyncApiSchema.v2.Bindings.Pulsar;
namespace Saunter.AsyncApiSchema.v2.Bindings
{
@@ -32,5 +33,8 @@ public class ServerBindings : IServerBindings
[JsonProperty("mqtt", NullValueHandling = NullValueHandling.Ignore)]
public MqttServerBinding Mqtt { get; set; }
+
+ [JsonProperty("pulsar", NullValueHandling = NullValueHandling.Ignore)]
+ public PulsarServerBinding Pulsar { get; set; }
}
}
diff --git a/test/Saunter.Tests/Generation/DocumentGeneratorTests/InterfaceAttributeTests.cs b/test/Saunter.Tests/Generation/DocumentGeneratorTests/InterfaceAttributeTests.cs
index a5183890..4fa225c8 100644
--- a/test/Saunter.Tests/Generation/DocumentGeneratorTests/InterfaceAttributeTests.cs
+++ b/test/Saunter.Tests/Generation/DocumentGeneratorTests/InterfaceAttributeTests.cs
@@ -3,13 +3,13 @@
// See the LICENSE file in the project root for more information.
using System;
+using System.Linq;
using System.Reflection;
using Saunter.AsyncApiSchema.v2;
using Saunter.Attributes;
using Saunter.Generation;
using Shouldly;
using Xunit;
-using System.Linq;
namespace Saunter.Tests.Generation.DocumentGeneratorTests
{