-
Notifications
You must be signed in to change notification settings - Fork 5
Добавлена поддержка swagger. #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Добавлен клиент к WebApi шины в ClientTools. Поднята версия сборок.
| <metadata> | ||
| <id>NewPlatform.Flexberry.ServiceBus.ClientTools</id> | ||
| <version>1.2.0</version> | ||
| <version>1.2.1</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Делаем всё через beta версии. К тому же в этом PR столько изменений, что тянет на изменении минорной версии. Надо указать во всех nuspec-файлах 1.3.0-beta01.
| using System.Linq; | ||
| using System.Reflection; | ||
| using System.Runtime.Serialization; | ||
| using System.Net; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using-и внутри namespace должны быть.
| /// <summary> | ||
| /// URL of REST-API of Service Bus. | ||
| /// </summary> | ||
| public string BaseUrl { get; set; } = "http://localhost:7085/RestService"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачем нужно такое умолчание? Как минимум, надо про это написать в комментарии.
| public async Task<ICollection<ServiceBusMessageInfo>> GetMessagesAsync(string clientId, CancellationToken cancellationToken) | ||
| { | ||
| if (clientId == null) | ||
| throw new ArgumentNullException(nameof(clientId)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Всегда используем {}.
| var response = await _httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); | ||
| try | ||
| { | ||
| var headers = Enumerable.ToDictionary(response.Headers, h => h.Key, h => h.Value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var используем только если по правой части хорошо понятно что это за тип. Тут и вокруг поправить.
| <Optimize>true</Optimize> | ||
| <DebugType>pdbonly</DebugType> | ||
| <PlatformTarget>AnyCPU</PlatformTarget> | ||
| <LangVersion>7.3</LangVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
У меня как-то в другом проекте эта директива вызывала падение сборки под mono.
| <PlatformTarget>x86</PlatformTarget> | ||
| <LangVersion>7.3</LangVersion> | ||
| <ErrorReport>prompt</ErrorReport> | ||
| <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Настройки разошлись. См. конфигурацию выше.
|
|
||
| public OptimizedSendingManager(ISubscriptionsManager subscriptionsManager, IStatisticsService statisticsService, IDataService dataService, ILogger logger, bool useLegacySenders = true) | ||
| : base(subscriptionsManager, statisticsService, dataService, logger, useLegacySenders) | ||
| public OptimizedSendingManager(ISubscriptionsManager subscriptionsManager, IStatisticsService statisticsService, IDataService dataService, ILogger logger) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это изменение API требует перекомпиляции решения на основе этого класса, поэтому, по правилам semver надо поднимать хотя бы вторую цифру, а не третью.
| // // Файл документации для моделей. | ||
| // c.IncludeXmlComments(Path.Combine(execDirPath, "NewPlatform.Flexberry.ServiceBus.Objects.xml")); | ||
| // }).EnableSwaggerUi(); | ||
| config.EnableSwagger( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может сделать это опциональным? Не всем инстанциям шины это надо. Хорошо бы законфигурировать или дать возможность отключить.
| /// If <c>true</c>, legacy types of message senders will be created. | ||
| /// </summary> | ||
| private readonly bool useLegacySenders; | ||
| public bool UseLegacySenders = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В комментарии можно указать про default value.
Добавлен клиент к WebApi шины в ClientTools.
Поднята версия сборок.