Skip to content

Releases: FastComments/fastcomments-nim

Release 1.1.0

09 Jan 01:10
de9de3a

Choose a tag to compare

Adds: email-templates, hash-tags, moderators, notification-count, notifications, pending-webhook-events, question-config, question-results, tenant-daily-usage, tenant-packages, tenants, tenant-users, users, votes

Release 1.0.1

21 Nov 16:07
30f0da3

Choose a tag to compare

  • Remove large amounts of manually-written custom JSON serialization/deserialization code across many generated model files.
  • Replace direct calls to model_api_status.to(...) with the more consistent to(...) usage (standardized deserialization of APIStatus) across numerous response models, e.g.: model_api_create_user_badge_response.nim, model_api_get_comment_response.nim.
  • Fix array deserialization for several fields by iterating array items manually and constructing sequences instead of relying on a generic to(...) call. Affected deserializations include: GetEventLogResponse.events, GetFeedPostsResponse.feedPosts, GetPublicFeedPostsResponse.feedPosts, PublicFeedPostsResponse.feedPosts, GetSSOUsers200response.users (generator patterns), and PublicComment.children (optional children array).
  • Standardize JSON serialization calls to use % (JsonNode conversion) and to(...) consistently across models; removed duplicated or redundant manual field-handling in many model files.
  • Add proper conditional handling for optional arrays/objects during deserialization in several models (check for JArray before iterating, and for JNull before setting Option values) to make (de)serialization safer and consistent.
  • Reintroduce/ensure consistent default enum and to* implementations (no semantic changes) and add trailing newlines where missing across many model files (formatting/whitespace cleanup).
  • Minor model shape/type clarifications and field additions where generated types already expected Option[] or seq[] remained unchanged but had manual procs removed (examples: many types now rely on generated to/% behaviour for fields such as Table, seq, Option and JsonNode).
  • Several response variants that previously included custom anyOf deserialization debug/echo logic remain but had their trailing newline/formatting normalized (no functional change) (examples: many *200response and *200responseAnyOf files).

Release 1.0.0

21 Nov 07:03
b9bc801

Choose a tag to compare

This is the first release listed as a GH tag. 0.0.1 was not listed.

  • BREAKING: Converted many model fields from concrete types to Option[...] (nullable/optional) across the SDK. Consumers must update code that expects non-optional fields (e.g. APIComment, APICommentBase, FComment, PublicComment, CreateCommentParams, CreateAPISSOUserData, many response/model types).
  • BREAKING: Several 200 response types were changed from a single concrete object shape to anyOf-style (sum) variants with a discriminated enum and custom deserializers (e.g. AddDomainConfig200response, AggregateQuestionResults200response, BlockFromCommentPublic200response, BulkAggregateQuestionResults200response, CombineCommentsWithQuestionResults200response, CreateCommentPublic200response, CreateFeedPost200response, CreateFeedPostPublic200response, CreateUserBadge200response, DeleteComment200response, DeleteCommentPublic200response, DeleteCommentVote200response, DeleteFeedPostPublic200response, DeletePage/Domain/SSO/Subscription responses, FlagComment200response, FlagCommentPublic200response, GetAuditLogs200response, GetComment200response, GetComments200response, GetCommentsPublic200response, GetEventLog200response, GetFeedPosts200response, GetFeedPostsPublic200response, GetFeedPostsStats200response, GetUserBadge200response, GetUserBadgeProgressById200response, GetUserBadgeProgressList200response, GetUserBadges200response, GetUserNotificationCount200response, GetUserNotifications200response, GetUserPresenceStatuses200response, GetUserReactsPublic200response, LockComment200response, PinComment200response, ResetUserNotifications200response, SaveComment200response, SaveCommentResponse variants, SearchUsers200response, SetCommentText200response, UpdateUserBadge200response, UnBlockCommentPublic200response, VoteComment200response).
  • API change: constructResult template simplified to always parse JSON via to(parseJson(response.body), T) (replaces special-case Table/marshal logic). This affects response deserialization behavior.
  • Improvement: API client query parameter building refactored in api_default.nim and api_public.nim to dynamically build a seq[(string,string)] and only include parameters when not empty / present. This avoids sending empty parameters and improves handling of optional query params across many endpoints (e.g. addDomainConfig, addPage, aggregate, aggregateQuestionResults, blockUserFromComment, bulkAggregateQuestionResults, combineCommentsWithQuestionResults, createFeedPost, createSubscription, createUserBadge, deleteComment, deleteDomainConfig, deletePage, deleteSSOUser, deleteSubscription, deleteUserBadge, flagComment, getAuditLogs, getComment, getComments, getDomainConfig(s), getFeedPosts, getPageByURLId, getPages, getSSOUserByEmail/ById, getSSOUsers, getSubscriptions, getUserBadge/progress, getUserBadgeProgressList, getUserBadges, patchDomainConfig, patchPage, patchSSOUser, putDomainConfig, putSSOUser, saveComment, saveCommentsBulk, unBlockUserFromComment, unFlagComment, updateComment, updateFeedPost, updateUserBadge and many public API equivalents).
  • Models: Added robust custom JSON deserialization (proc to*) and serialization (proc *) for many models to correctly map JSON field names, support optional fields, arrays, tables and nested custom types (examples include APIComment, FComment, PublicComment, FeedPost, many response objects and other domain models). These custom serializers/deserializers were added across many model files.
  • Models: Added import of marshal and options to many model files where custom (de)serialization or Option types are used.
  • Models: Numerous enum types received JSON deserialization helpers (proc to*(..., typedesc[Enum])) so enums parse from string JSON values (examples: AggregateTimeBucket, AggregationOpType, Dir, CrudType, From, CommentHTMLRenderingMode, CommentQuestionResultsRenderingType, CommentQuestionsRequired, CommentThreadDeletionMode, CommentLogType, CommentQuestionResultsRenderingType, GifRating, ImageContentProfanityLevel, LiveEventType, NotificationType, Note/Code etc.).
  • Models: Introduced several anyOf/unioned model types and discriminators for responses and some wrapper types (e.g. QueryPredicateValue, RecordStringStringOrNumberValue, AddDomainConfig200responseAnyOf, GetDomainConfigs200responseAnyOf, many others) with custom deserializers to try different variants.
  • API behavior: Public API variants (api_public.nim) updated to the same dynamic query param behavior and improved handling of optional parameters (e.g. sso, sessionId, broadcastId, tags, hashTags, pagination flags, booleans, etc.).
  • API improvement: multipart/form-data uploadImage now builds query params only when provided and uses new encodeQuery on a dynamic list.
  • Models: Arrays and table typed fields that previously were plain required now are often Option[...] (e.g. tags, media, links, badges, mentions, hashTags, moduleData, translations, etc.) to reflect optional presence in responses.
  • Models: Added many small convenience/customizations such as treating database _id fields and mapping them to id when appropriate in deserializers, and handling JNull values safely.
  • Docs/OpenAPI: openapi.json and model docs updated to reflect new/optional fields: added noNewRootComments and other schema updates; PublicComment and PublicCommentBase updated to include approved; PatchPageAPIResponse has commentsUpdated; CreateUserBadge response includes notes; CustomConfigParameters includes noNewRootComments; corresponding docs in docs/Models were updated.
  • Consistency: Many model files that previously relied on generic marshal.to conversion now use explicit to(...) conversions to improve robustness and to support Option fields and custom anyOf handling.
  • Misc: Numerous small model fields renamed to optional equivalents and many model-specific helper procs added to support round-trip JSON serialization for Option fields and complex nested types.
  • Testing/compat: Because of the scope of type changes (Option[...] and anyOf variants), client code must be updated to handle optional fields and pattern-match anyOf response variants where applicable.