[PR #215] [MERGED] feat(scripts): build the API schema from both the account and the anonymous view #213

Closed
opened 2026-10-13 19:48:56 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Glitchy-Sheep/boosty-downloader/pull/215
Author: @Glitchy-Sheep
Created: 9/24/2026
Status: ✅ Merged
Merged: 9/24/2026
Merged by: @Glitchy-Sheep

Base: main ← Head: feat/api-schema-both-views


📝 Commits (2)

  • 237812f feat(scripts): read the API with and without the token for the schema
  • 9d72b0c docs: regenerate the Boosty API schema with both views

📊 Changes

3 files changed (+68 additions, -31 deletions)

View changed files

📝 docs/api/README.md (+1 -1)
📝 docs/api/boosty-api.yaml (+24 -11)
📝 scripts/api_schema/__main__.py (+43 -19)

📄 Description

📝 Summary

The weekly report warned about Post.price and Post.subscriptionLevel.price turning into fractional numbers. Boosty changed nothing there: a stranger gets price in USD (1.26), the account gets it in RUB (100). The schema was read with the token, the canary reads without one, so the warning would come every week. The schema now covers both views.

🔧 What changes

  • With a token, task api:schema and task api:changes read every blog twice: with the token and without it. Without a token they read once, as before.
  • The schema is regenerated from both views of glitchy_sheep. It now holds price as integer | number, and keys only the account sees (views, hasActivePromo) became optional. x-observed counts the views.
  • The two new keys hasAIContent and forbiddenChangeHasAIContent join the schema. The client does not read them; they are false on every post so far.
  • docs/api/README.md says why the blogs are read twice.

💡 Why

The client is not affected: prices come from currencyPrices['RUB'], which is the same in both views, and price is a float in the models. Only the warning was false.

🧪 Tests

  • Before: anonymous price 1.26 / tier 0.13, with the token 100 / 10, currencyPrices the same.
  • After regenerating: task api:changes -- glitchy_sheep --anonymous, the canary's call, finds nothing new.
  • 360 tests pass: the synthetic post still fits the schema. ruff and pyright pass.

✅ Checklist

  • Tested live on a real blog (feature or fix)
  • Updated CLI --help and README if needed
  • Updated docs/ if the download flow or dev process changed
  • Added a line to ## Unreleased in CHANGELOG.md (or the ci/skip-changelog label if not user-facing)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Glitchy-Sheep/boosty-downloader/pull/215 **Author:** [@Glitchy-Sheep](https://github.com/Glitchy-Sheep) **Created:** 9/24/2026 **Status:** ✅ Merged **Merged:** 9/24/2026 **Merged by:** [@Glitchy-Sheep](https://github.com/Glitchy-Sheep) **Base:** `main` ← **Head:** `feat/api-schema-both-views` --- ### 📝 Commits (2) - [`237812f`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/237812f3963f4b0bdfce946adc74a5dc1f26ac76) feat(scripts): read the API with and without the token for the schema - [`9d72b0c`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/9d72b0c687888d7c3a91298036926ad045df3ed9) docs: regenerate the Boosty API schema with both views ### 📊 Changes **3 files changed** (+68 additions, -31 deletions) <details> <summary>View changed files</summary> 📝 `docs/api/README.md` (+1 -1) 📝 `docs/api/boosty-api.yaml` (+24 -11) 📝 `scripts/api_schema/__main__.py` (+43 -19) </details> ### 📄 Description ## 📝 Summary The weekly report warned about `Post.price` and `Post.subscriptionLevel.price` turning into fractional numbers. Boosty changed nothing there: a stranger gets `price` in USD (`1.26`), the account gets it in RUB (`100`). The schema was read with the token, the canary reads without one, so the warning would come every week. The schema now covers both views. ## 🔧 What changes - With a token, `task api:schema` and `task api:changes` read every blog twice: with the token and without it. Without a token they read once, as before. - The schema is regenerated from both views of `glitchy_sheep`. It now holds `price` as `integer | number`, and keys only the account sees (`views`, `hasActivePromo`) became optional. `x-observed` counts the views. - The two new keys `hasAIContent` and `forbiddenChangeHasAIContent` join the schema. The client does not read them; they are `false` on every post so far. - `docs/api/README.md` says why the blogs are read twice. ## 💡 Why The client is not affected: prices come from `currencyPrices['RUB']`, which is the same in both views, and `price` is a `float` in the models. Only the warning was false. ## 🧪 Tests - Before: anonymous `price` 1.26 / tier 0.13, with the token 100 / 10, `currencyPrices` the same. - After regenerating: `task api:changes -- glitchy_sheep --anonymous`, the canary's call, finds nothing new. - 360 tests pass: the synthetic post still fits the schema. ruff and pyright pass. ## ✅ Checklist <!-- Tick an item that doesn't apply too --> - [x] Tested live on a real blog (feature or fix) - [x] Updated CLI `--help` and README if needed - [x] Updated `docs/` if the download flow or dev process changed - [x] Added a line to `## Unreleased` in CHANGELOG.md (or the `ci/skip-changelog` label if not user-facing) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-13 19:48:56 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Glitchy-Sheep/boosty-downloader#213
No description provided.