feat(piefed): refresh schema from live swagger#35
Merged
Conversation
The previous schema source (freamon.github.io/piefed-api) hadn't been
updated since Sept 2025; piefed.social serves a current
`/api/alpha/swagger.json` that reflects the live API. Switch to it.
Fixes surfaced by the new types:
- `createPostReport` needs `report_remote: true` (we were sending it on
`createCommentReport` but not the post variant)
- `featurePost` `feature_type` must be PascalCase (`Community`/`Local`),
not snake_case
Also narrows two `fromListingType` return annotations that were widened
to the full Lemmy enum even though the maps can't emit the extra values
("Popular"), removing one `@ts-expect-error`.
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
freamon.github.io/piefed-api/swagger.yaml(last updated Sept 2025) topiefed.social/api/alpha/swagger.json(live). 5193 → 7944 lines, mostly newly-typed endpoints.createPostReportwas missing the requiredreport_remote: true(we already had it oncreateCommentReport)featurePostwas sending snake_casefeature_type("community"/"local") where piefed expects PascalCasefromListingTypereturn type in bothlemmyv0/compat.tsandpiefed/compat.ts— the explicit annotations widened the return to include"Popular"even though the runtime map can't emit it. Removed one resulting@ts-expect-error.src/providers/piefed/README.Test plan
pnpm test(19 tests pass)pnpm test:typescleanpiefed.social(getSite/getPosts/getComments/listCommunities/search/getPost)Follow-up not in scope
The narrowed
fromListingTypesurfaced a separate type leak inlistCommunities: thesort?field from threadiverse's mode-keyed union pulls in v1's snake_case values (e.g."comments"), which piefed correctly rejects. Restored a focused@ts-expect-errorwith that explanation; properly threading mode-specific sorts through the BaseClient signatures is a bigger refactor.