Skip to content

Commit

Permalink
[Host.AsyncApi] Remove references to non existing bindings
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Maruszak <maruszaktomasz@gmail.com>
  • Loading branch information
zarusz committed Apr 26, 2023
1 parent b724452 commit d7f01a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Host.Transport.Properties.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Import Project="Common.Properties.xml" />

<PropertyGroup>
<Version>2.1.2</Version>
<Version>2.1.3</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

Expand Down
10 changes: 2 additions & 8 deletions src/SlimMessageBus.Host.AsyncApi/MessageBusDocumentGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

using Saunter;
using Saunter.AsyncApiSchema.v2;
using Saunter.AsyncApiSchema.v2.Bindings;
using Saunter.Attributes;
using Saunter.Generation;
using Saunter.Generation.Filters;
Expand Down Expand Up @@ -44,13 +43,13 @@ public AsyncApiDocument GenerateDocument(TypeInfo[] asyncApiTypes, AsyncApiOptio
// ToDo: implement
var serverByBusSettings = new Dictionary<MessageBusSettings, NamedServer>
{
{ _busSettings, new("root", new Server("kafka://kafka.cluster", "kafka")) }
{ _busSettings, new("root", new Server("smb://smb.cluster", "kafka")) }
};
foreach (var childMessageBusSettings in _busSettings.Children)
{
if (busFilter == null || busFilter(childMessageBusSettings))
{
serverByBusSettings.Add(childMessageBusSettings, new(childMessageBusSettings.Name, new Server("kafka://kafka.cluster", "kafka")));
serverByBusSettings.Add(childMessageBusSettings, new(childMessageBusSettings.Name, new Server("smb://smb.cluster", "kafka")));
}
}

Expand Down Expand Up @@ -106,7 +105,6 @@ private static void GenerateChannelsFromConsumers(IDictionary<string, ChannelIte
{
Description = $"{consumer.PathKind}: {consumer.Path}",
Subscribe = subscribeOperation,
Bindings = new ChannelBindingsReference(namedServer.Name),
Servers = new List<string> { namedServer.Name },
};

Expand Down Expand Up @@ -140,7 +138,6 @@ private static void GenerateChannelsFromProducers(IDictionary<string, ChannelIte
{
Description = $"{producer.PathKind}: {producer.DefaultPath}",
Publish = publishOperation,
Bindings = new ChannelBindingsReference(namedServer.Name),
Servers = new List<string> { namedServer.Name },
};

Expand Down Expand Up @@ -172,7 +169,6 @@ private static void GenerateChannelsFromProducers(IDictionary<string, ChannelIte
Summary = consumerHandleMethod!.GetXmlDocsSummary() ?? consumerType.GetXmlDocsSummary(),
Description = (!string.IsNullOrEmpty(consumerHandleMethod!.GetXmlDocsRemarks()) ? consumerHandleMethod!.GetXmlDocsRemarks() : null) ?? (!string.IsNullOrEmpty(consumerType.GetXmlDocsRemarks()) ? consumerType.GetXmlDocsRemarks() : null),
Message = messages,
Bindings = new OperationBindingsReference(namedServer.Name),
};

// Add all message types pushed via this channel (topic/queue)
Expand Down Expand Up @@ -210,7 +206,6 @@ internal static string GetMessageId(Type messageType)
{
OperationId = $"{producer.DefaultPath}_{producer.MessageType.Name}",
Message = messages,
Bindings = new OperationBindingsReference(namedServer.Name),
};

// Add all message types pushed via this channel (topic/queue)
Expand All @@ -237,7 +232,6 @@ private static IMessage GenerateMessageFromAttribute(Type messageType, AsyncApiS
Title = messageType.Name,
Summary = messageType.GetXmlDocsSummary(),
Description = messageType.GetXmlDocsRemarks(),
Bindings = new MessageBindingsReference(namedServer.Name),
};
message.Name = message.Payload.ActualSchema.Id;

Expand Down

0 comments on commit d7f01a9

Please sign in to comment.