docs(openapi): hide 22 website-only routes from public spec#168
docs(openapi): hide 22 website-only routes from public spec#168
Conversation
Every route protected by websiteOnlyCors middleware is origin-locked to
bitbadges.io and will 403 for any third-party developer. These 22 routes
were still publicly listed in the Stoplight spec with x-internal: false,
which misleads integrators into writing clients against endpoints they
cannot call.
Flipping x-internal: true keeps the descriptions in routes.yaml (useful
for internal reference) while removing them from the published public
docs.
Routes affected:
- Liquidity pools: /pools, /pools/byDenom, /pools/byAssets, /pools/{poolId}
- Swaps: /swaps/estimate
- Asset pairs: /assetPairs plus 7 variants (topGainers, topLosers, etc.)
- Swap analytics: /swapActivities
- On-chain dynamic stores: 4 read routes
- Off-chain dynamic stores: POST/PUT/DELETE /dynamicStores
Safe-by-default change — this hides routes, it does not expose any
previously hidden functionality. Not auto-merged because some of these
may actually be intended for public consumption in the future; a human
should confirm the wording is right before merge.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR corrects the public OpenAPI specification by marking 22 routes as
Confidence Score: 5/5Safe to merge — purely a spec metadata change, no runtime behaviour altered All 22 flips are mechanical one-line changes (x-internal: false → x-internal: true) that only affect Stoplight rendering. No logic, schema, or description content is modified, and the change cannot expose new attack surface. PR description matches the diff exactly. No files require special attention
|
| Filename | Overview |
|---|---|
| packages/bitbadgesjs-sdk/openapitypes-helpers/routes.yaml | Flips x-internal from false → true for 22 website-only routes (pools ×4, swaps/estimate, assetPairs ×9, swapActivities, onChainDynamicStore ×4, dynamicStores ×3); no descriptions removed, no logic changed |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[routes.yaml] -->|x-internal: true| B[Stoplight renderer]
B -->|hidden| C[Public API reference]
subgraph Affected routes - 22 total
F[pools x4]
G[swaps/estimate x1]
H[assetPairs x9]
I[swapActivities x1]
J[onChainDynamicStore x4]
K[dynamicStores POST/PUT/DELETE x3]
end
F & G & H & I & J & K --> A
Reviews (1): Last reviewed commit: "docs(openapi): hide 22 website-only rout..." | Re-trigger Greptile
…esolve Both types are transitively $ref'd by SkipGoMessage in the generated openapi spec, but they were defined without `export` so typeconv skipped them. The hosted spec shipped broken #/components/schemas/EvmTx and MultiChainMsg references that failed to resolve in Stoplight. One-word-each fix. Implements backlog #0292 (partial — the 5 dynamic-store + swap-activities types deferred until PR #168 merges the websiteOnlyCors route hiding). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…esolve (#171) Both types are transitively $ref'd by SkipGoMessage in the generated openapi spec, but they were defined without `export` so typeconv skipped them. The hosted spec shipped broken #/components/schemas/EvmTx and MultiChainMsg references that failed to resolve in Stoplight. One-word-each fix. Implements backlog #0292 (partial — the 5 dynamic-store + swap-activities types deferred until PR #168 merges the websiteOnlyCors route hiding). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
22 routes in the public OpenAPI spec are protected by
websiteOnlyCorsmiddleware in the indexer, which means they reject any request whoseOriginisn'tbitbadges.io. Listing them as public endpoints misleads third-party developers into writing clients against routes they cannot call — they then hit CORS and file support tickets.This PR flips
x-internal: false->x-internal: truefor all of them so Stoplight stops rendering them in the public reference.Routes hidden
/pools,/pools/byDenom,/pools/byAssets,/pools/{poolId}/swaps/estimate/assetPairs, topGainers/topLosers/highestVolume/priceSorted/weeklyTopGainers/weeklyTopLosers/search/byDenoms/swapActivities/onChainDynamicStore/{storeId},/onChainDynamicStore/{storeId}/value/{address},/onChainDynamicStore/{storeId}/values,/onChainDynamicStores/by-creator/{address}/dynamicStoresNo descriptions are deleted — only the
x-internalflag flips. Safe-by-default: this hides, it does not expose anything new.Test plan
websiteOnlyCorsmiddleware in the indexer needs to come off first — don't unflipx-internalwithout that change, or we'd re-introduce the broken CORS experience.genapi.ymlCI; verify the resulting hosted spec drops these paths.Generated by the docs-watch agent (daily OpenAPI quality sweep).