Repository navigation
Ask for drafts by default in Api.get_drafts - #93
Open
MattFisher wants to merge 1 commit into
Open
MattFisher wants to merge 1 commit into
MattFisher wants to merge 1 commit into
Conversation
Substack's draft listing endpoint now answers 400 "Invalid value" for the filter parameter when none is sent, so get_drafts() failed unless the caller passed filter="draft" explicitly. Make that the default. Co-Authored-By: Claude <noreply@anthropic.com>
This branch has not been deployed
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.
Api.get_drafts()fails withAPIError(code=400): Invalid valuewhen called without afilter. This PR makesfilter="draft"the default.The problem
Substack's draft listing endpoint now rejects requests that have no
filterparameter:get_drafts()defaults tofilter=None, andrequestsdropsNoneparameters, so the default call always gets the 400. The CLI and the MCP server already passfilter="draft"themselves, so only direct callers ofApi.get_drafts()are affected. The repo's own live testtest_api.py::ApiTest::test_get_draftscurrently fails for this reason.The change
get_drafts(filter="draft", offset=None, limit=None).filteris for.Callers that pass a filter explicitly behave exactly as before.
Testing
filter=draft.pytest -q -m "not live" --strict-markers: 292 passed.🤖 Generated with Claude Code