fix(docs): align /account OpenAPI spec + docs with live flat response (SHA-3188)#230
Conversation
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
|
Self-merge audit (2026-05-21): re-verified against live OVH |
|
Merge gate (auto-classified): gate=smoke-passed — auto-classified by the gate-log enforcer (9min after merge, no Posted by |
Fixes #SHA-3188 (Paperclip)
Summary
Customer Phil Goodrich (Pro) reported that
docs.sharpapi.io/openapi.jsondescribesAccountwith a nesteddata.key.*+data.limits.*shape and object-of-booleansfeatures, butapi.sharpapi.io/api/v1/accountactually returns a flat shape withkey_id,tier,rate_limit,features(string array), andstreaming. The Go handler insharp-api-go/endpoints.go:accountHandleris the canonical source.This PR aligns the spec + every locale of the
/accountreference page to the live shape, bumpsinfo.version, and adds a versioning policy note.Changes
public/openapi.jsonAccountcomponent schema with the flat shape.key_id,tier,rate_limit,features,streaming(all 5 are always emitted).key,limits,addons,streaming_trial(stale).featuresbecomesarray<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 fromstreaming_trial).rate_limit.{requests_per_minute, max_books}(renamed fromlimits;max_streams+odds_delay_secondsdropped as they are not emitted)./account200 response example to match (drop the spurioussuccess: trueflag —DataEnvelopeis success-implicit; hoistupdated_atto the top level).info.version2.0.0→2.1.0. (The earlier silent removal of/sports/{sportId}and/sportsbooks/{bookId}should have bumped the minor; this version covers both.)info.descriptiondeclaring the policy going forward.content/{en,es,de,pt-BR}/api-reference/account.mdxfeatures.includes('ev')replaces the oldfeatures.evboolean check in the use-case example.meta.updated_at→ top-levelupdated_at(already specified byDataEnvelope).Verification
pnpm typecheckpasses (no diagnostics).jq -e '.info.version, .components.schemas.Account.required[]' public/openapi.jsonreturns"2.1.0"+ the 5 expected required keys.grep -r 'data\.key\.\|data\.limits\.\|streaming_trial\|data\.addons'over the worktree returns no matches.GET https://api.sharpapi.io/api/v1/accountwas used as the on-the-wire reference; cross-checked against the Go handler insharp-api-go/endpoints.go:1318.Test plan
/accountpages without MDX errors.docs.sharpapi.io/openapi.jsonon the preview showsinfo.version: 2.1.0and the new flatAccountschema.key_id/rate_limit/features[]/streamingpaths cleanly.