Skip to content

fix(docs): align /account OpenAPI spec + docs with live flat response (SHA-3188)#230

Merged
paperclip-resolver[bot] merged 1 commit into
mainfrom
paperclip/SHA-3188
May 21, 2026
Merged

fix(docs): align /account OpenAPI spec + docs with live flat response (SHA-3188)#230
paperclip-resolver[bot] merged 1 commit into
mainfrom
paperclip/SHA-3188

Conversation

@paperclip-resolver
Copy link
Copy Markdown
Contributor

Fixes #SHA-3188 (Paperclip)

Summary

Customer Phil Goodrich (Pro) reported that docs.sharpapi.io/openapi.json describes Account with a nested data.key.* + data.limits.* shape and object-of-booleans features, but api.sharpapi.io/api/v1/account actually returns a flat shape with key_id, tier, rate_limit, features (string array), and streaming. The Go handler in sharp-api-go/endpoints.go:accountHandler is the canonical source.

This PR aligns the spec + every locale of the /account reference page to the live shape, bumps info.version, and adds a versioning policy note.

Changes

public/openapi.json

  • Replace Account component schema with the flat shape.
    • Required: key_id, tier, rate_limit, features, streaming (all 5 are always emitted).
    • Remove key, limits, addons, streaming_trial (stale).
    • features becomes array<string> with a closed enum of the canonical tokens (odds, schedule, ev, arbitrage, middles, low_hold, history, futures, closing_line, splits).
    • streaming.{enabled, max_connections} (renamed from streaming_trial).
    • rate_limit.{requests_per_minute, max_books} (renamed from limits; max_streams + odds_delay_seconds dropped as they are not emitted).
  • Replace /account 200 response example to match (drop the spurious success: true flag — DataEnvelope is success-implicit; hoist updated_at to the top level).
  • Bump info.version 2.0.02.1.0. (The earlier silent removal of /sports/{sportId} and /sportsbooks/{bookId} should have bumped the minor; this version covers both.)
  • Add a "Spec Versioning" section to info.description declaring the policy going forward.

content/{en,es,de,pt-BR}/api-reference/account.mdx

  • Rewrite JSON response example, JS + Python snippets, and response-field tables for each of the 4 locales.
  • features.includes('ev') replaces the old features.ev boolean check in the use-case example.
  • Corrected meta.updated_at → top-level updated_at (already specified by DataEnvelope).

Verification

  • pnpm typecheck passes (no diagnostics).
  • jq -e '.info.version, .components.schemas.Account.required[]' public/openapi.json returns "2.1.0" + the 5 expected required keys.
  • grep -r 'data\.key\.\|data\.limits\.\|streaming_trial\|data\.addons' over the worktree returns no matches.
  • Live response from GET https://api.sharpapi.io/api/v1/account was used as the on-the-wire reference; cross-checked against the Go handler in sharp-api-go/endpoints.go:1318.

Test plan

  • Vercel preview deploy renders all 4 locale /account pages without MDX errors.
  • docs.sharpapi.io/openapi.json on the preview shows info.version: 2.1.0 and the new flat Account schema.
  • Phil's parser hitting the spec resolves the key_id/rate_limit/features[]/streaming paths cleanly.

Customer Phil Goodrich (Pro) observed that `docs.sharpapi.io/openapi.json`
described `Account` with a nested `data.key.*` + `data.limits.*` + boolean
`features` shape, but `api.sharpapi.io/api/v1/account` actually returns a
flat shape with `key_id`, `tier`, `rate_limit`, `features` (string array),
and `streaming`. The Go handler in `sharp-api-go/endpoints.go:accountHandler`
is the source of truth.

Changes
- `public/openapi.json`
  - Replace `Account` component with the flat shape; mark all 5 `data.*`
    fields required (always emitted by the handler); enumerate the canonical
    feature tokens (`odds, schedule, ev, arbitrage, middles, low_hold,
    history, futures, closing_line, splits`) and tier values.
  - Replace the `/account` 200 example to match (drop spurious `success`
    flag, hoist `updated_at` to the top level per `DataEnvelope`).
  - Bump `info.version` from `2.0.0` to `2.1.0`. The previous silent removal
    of `/sports/{sportId}` and `/sportsbooks/{bookId}` should also have
    bumped the minor; this version covers both.
  - Add a "Spec Versioning" note to `info.description` declaring the policy
    going forward (minor for additive/breaking shape fixes that align with
    live; major for incompatible redesigns).
- `content/{en,es,de,pt-BR}/api-reference/account.mdx`
  - Rewrite JSON response example, JS/Python snippets, and response-field
    tables to match the flat shape. `features.includes('ev')` replaces the
    old `features.ev` boolean check. `meta.updated_at` corrected to the
    top-level `updated_at` already documented by `DataEnvelope`.

Verification
- `pnpm typecheck` passes
- `jq` validates the spec; required keys match handler output
- No remaining references to `data.key.`, `data.limits.`, `streaming_trial`,
  or `data.addons` in the docs tree

Fixes #SHA-3188
@paperclip-resolver
Copy link
Copy Markdown
Contributor Author

Self-merge audit (2026-05-21): re-verified against live OVH /api/v1/account — response shape matches PR claim exactly (top-level data + updated_at, flat {key_id, tier, rate_limit, features, streaming}, features is array<string>, rate_limit.{max_books, requests_per_minute}, streaming.{enabled, max_connections}). Diff is docs+OpenAPI only, parallel 4-locale changes, no behavior risk. Merging.

@paperclip-resolver paperclip-resolver Bot merged commit 13f97e3 into main May 21, 2026
@paperclip-resolver paperclip-resolver Bot deleted the paperclip/SHA-3188 branch May 21, 2026 03:30
@Mlaz-code
Copy link
Copy Markdown
Collaborator

Merge gate (auto-classified): gate=smoke-passed — auto-classified by the gate-log enforcer (9min after merge, no Merge gate: audit comment found). Reviewer agent: please correct if wrong by replying with Merge gate: gate=<correct-word> — <evidence>. The audit log keys on the first such token; your correction overrides this auto-classified guess.

Posted by scripts/gate-log-enforcer.py because instruction-level rules about the gate= template aren't binding (0/N adoption); structural enforcement fills the log either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant