Repository navigation
release v0.8.0-alpha: typed models aligned with MAX OpenAPI schema - #44
Merged
Merged
Conversation
- Every enum carries a snake_case JsonConverter, so models and enums deserialize with any JsonSerializerOptions (MessageLinkType failed with default options). - LinkedMessage.Type, MessageRecipient.ChatType, MarkupElement.Type are enums; InlineKeyboardAttachment.Payload is a typed InlineKeyboard; Chat.Participants and Image.Photos are typed dictionaries. - Required schema fields are non-nullable (Message, MessageBody, User, Chat, ChatMember, CallbackQuery, typed update wrappers, attachments, Video). - Add chat buttons, DataAttachment, ModifyMembersResponse, GetChatMembersByIdsAsync and RemoveChatMemberAsync(block). - Release workflow publishes the GitHub release as Latest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013pSNnawFkxH4NpFXTzqjCT
…ptions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013pSNnawFkxH4NpFXTzqjCT
- MaxJsonSerializer.Options: UpdateTypeJsonConverter precedes the generic enum converter, so unknown update types map to UpdateType.Unknown instead of failing GET /subscriptions. - Required fields tolerate an explicit JSON null (0, empty string, new object). - reply_keyboard: ReplyKeyboardAttachment, ReplyKeyboardButton and AttachmentRequest.ReplyKeyboard; unknown attachments become UnknownAttachment with the raw JSON instead of an empty DocumentAttachment. - Typed update wrappers are JSON-mapped; BotAddedUpdate.InviterId and DialogMuted/Unmuted IsMuted are derived; Update.IsChatInferred is public. - Typed VideoUrls and UpdateChatRequest.Icon; add User.IsOfficial, SetWebhookRequest.Version/SelfSignedCert, Subscription.SelfSignedCert. - Fix docs and changelog wording and footer links. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013pSNnawFkxH4NpFXTzqjCT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Отзыв пользователя:
JsonSerializer.SerializeToElement("reply").Deserialize<MessageLinkType>()падал, потому что уMessageLinkTypeне было[JsonConverter]. Кроме того, модели отдавали сырые строки и объекты, а nullability расходилась с документацией, поэтому приходилось много разбирать вручную и ставить null-проверки.Что сделано
Enum'ы
JsonSnakeCaseEnumConverter<TEnum>, аUpdateType— своимUpdateTypeJsonConverter. Enum'ы и модели разбираются и обычнымJsonSerializerс опциями по умолчанию.MaxJsonSerializer.Optionsобщий enum-конвертер перекрывалUpdateTypeJsonConverter. Из-за этого новый тип события (например,comment_created) ронялGET /subscriptions.Типизированные модели
LinkedMessage.TypeтеперьMessageLinkType?,MessageRecipient.ChatType—ChatType?,MarkupElement.Type—MarkupType?. Неизвестное значение даётnull, а не исключение.InlineKeyboardAttachment.PayloadтеперьInlineKeyboardвместоDictionary<string, object>.Chat.Participants,Image.Photos,Video.Urls(VideoUrls) иUpdateChatRequest.Icon.Nullability по схеме
Message,MessageBody,User,Chat,ChatMember,CallbackQuery, вложения,Video,Timestamp, а также обязательные поля типизированных обёрток событий.nullот API в этих полях превращается в0,""или пустой объект и не роняет разбор.Новое
chat.ReplyKeyboardAttachment, отправка черезAttachmentRequest.ReplyKeyboard.DataAttachmentиUnknownAttachment.ModifyMembersResponseс полямиfailed_user_idsиfailed_user_details.GetChatMembersByIdsAsyncиRemoveChatMemberAsync(..., block).User.IsOfficial,SetWebhookRequest.VersionиSetWebhookRequest.SelfSignedCert.Релиз
release.ymlпубликует GitHub Release как Latest. При ручном запуске это можно отключить параметромlatest.0.8.0-alpha. Breaking changes перечислены в CHANGELOG.Ревью
Два независимых read-only ревьюера сверили изменения со схемой
max-bot-api-client-go/schema.yaml. Подтверждённые находки исправлены во втором коммите: порядок конвертеров, толерантность кnull,reply_keyboard, маппинг обёрток, документация.Проверки
dotnet build -warnaserrordotnet test: 776/776 на net10.0 и на net8.0dotnet format --verify-no-changesdotnet format analyzers --verify-no-changesGenerated by Claude Code