Align response schemas with source presenters#29
Merged
Conversation
The size field is backed by a BIGINT column which is serialized as a string, causing numeric validation to fail on responses like '0'. Change size to a string type. Also align the FileOperation schema with the actual presenter output: add format, name, error, collectionId, documentId, and updatedAt, and replace the embedded collection object with collectionId.
Audited every schema with a backing presenter against the Outline source and corrected the documented response shapes: - Attachment: size is BIGINT (serialized as a string) — change number to string; add userId; mark documentId nullable. - User: add color, timezone, updatedAt, deletedAt; mark lastActiveAt nullable. - Team: remove collaborativeEditing (no longer returned); add description, memberTeamCreate, passkeysEnabled, domain, preferences, guidanceMCP. - Collection: add url, commenting, templateManagement, sourceMetadata, data; mark description, index, color, icon nullable. - Document: rename emoji to icon; replace embedded collaborators with collaboratorIds; remove pinned and dataAttributes (not returned); add url, color, data, tasks; mark collectionId, parentDocumentId, archivedAt nullable. - Comment: remove updatedBy (not returned); add createdById, resolvedAt, resolvedBy, resolvedById, reactions. - Revision: add name, data, icon, color, collaborators, createdById, deletedAt. - Share: add sourceTitle, sourcePath, documentId, collectionId, urlId, domain, allowIndexing, showLastUpdated, showTOC, views; mark lastAccessedAt nullable. - Star: remove documentUrl (not returned); add updatedAt; mark documentId and collectionId nullable. - Event: add userId and changes. - Group: add description, externalId, disableMentions, externalGroup. - OAuthClient: add clientType and lastActiveAt; mark description, developerName, developerUrl, avatarUrl nullable. - OAuthAuthentication: add oauthClient and createdAt. - Membership: add documentId, createdById, sourceId, index; mark collectionId nullable. - GroupMembership: remove userId and user (not returned); add documentId, collectionId, permission, sourceId. - CollectionGroupMembership: add documentId and sourceId; mark collectionId nullable. - Template: mark publishedAt nullable. - View: add userId. - Remove now-unused DocumentDataAttribute schema.
These are populated by a downstream repository and are part of the document response, so they should remain documented.
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.
Summary
A reported validation error (
Input should be a valid number [type=float_type, input_value='0', input_type=str]) traced back to theFileOperation.sizefield being documented as anumberwhile the API actually serializes it as a string —sizeis aBIGINTcolumn, which Sequelize serializes as a string to avoid JavaScript safe-integer precision loss.Since that class of mismatch could exist elsewhere, every response schema with a backing presenter was audited against the Outline source presenters and corrected so the documented output shape matches what the API actually returns.
Changes
Type correction (the original bug + its sibling)
FileOperation.size:number→string(BIGINT). Also added the other presenter fields:format,name,error,collectionId,documentId,updatedAt; replaced the embeddedcollectionobject withcollectionId.Attachment.size:number→string(BIGINT). AddeduserId; markeddocumentIdnullable.Fields that were documented but are not returned (removed)
Team.collaborativeEditingDocument.pinnedComment.updatedByStar.documentUrlGroupMembership.userId/userFields returned by presenters but missing (added)
User:color,timezone,updatedAt,deletedAtTeam:description,memberTeamCreate,passkeysEnabled,domain,preferences,guidanceMCPCollection:url,commenting,templateManagement,sourceMetadata,dataDocument:url,color,data,tasks; renamedemoji→icon; replaced embeddedcollaboratorswithcollaboratorIdsComment:createdById,resolvedAt,resolvedBy,resolvedById,reactionsRevision:name,data,icon,color,collaborators,createdById,deletedAtShare:sourceTitle,sourcePath,documentId,collectionId,urlId,domain,allowIndexing,showLastUpdated,showTOC,viewsStar:updatedAtEvent:userId,changesGroup:description,externalId,disableMentions,externalGroupOAuthClient:clientType,lastActiveAtOAuthAuthentication:oauthClient,createdAtMembership:documentId,createdById,sourceId,indexGroupMembership:documentId,collectionId,permission,sourceIdCollectionGroupMembership:documentId,sourceIdView:userIdNullability corrections applied to fields the models declare as nullable across
User,Collection,Document,Template,Share,Star,OAuthClient,Membership,GroupMembership, andCollectionGroupMembership.Validation
spectral lint --fail-severity=errorpasses (no errors).spec3.jsonregenerated from the YAML (same script the pre-commit hook runs).