Repository navigation
Add global describe and /limits REST endpoints - #18
Merged
Merged
Conversation
Two org-level REST resources were missing, so tools that discover an org's
shape before doing anything else could not work against the emulator:
- GET /services/data/{apiVersion}/sobjects — global describe. Lists the
baseline standard objects plus every object currently present in org
state, with keyPrefix, custom flag and the urls block clients follow to
reach per-object describes. The requested apiVersion is reflected in
those URLs rather than hardcoded.
- GET /services/data/{apiVersion}/limits — Max/Remaining for the limits
clients commonly display. Derived from org state (record count drives
DataStorageMB and API consumption) so it stays consistent with whatever
the emulator holds, and Remaining never goes negative.
Both are read-only and mounted on the existing /services/data and /data
prefixes. 5 controller tests added; full suite green (194 tests).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
razkevich
added a commit
to razkevich/sf9s
that referenced
this pull request
Jul 25, 2026
…elect The new tier runs the TUI against a live sf-localstack instance (a real Salesforce API emulator) behind a build tag, skipping when unreachable so 'go test ./...' stays hermetic. It immediately earned its keep: Selecting an org routed through an async message, so keystrokes typed right after enter were still delivered to the orgs view and silently dropped — 'SELECT ...' became 'ELECT ...'. Our own mock matched any query containing 'FROM Account', so it never noticed. Selection is now applied synchronously, the mock rejects statements a real org would reject, and a regression test types immediately after selecting. sf-localstack needed /sobjects (global describe) and /limits to serve this suite; both are proposed upstream in razkevich/sf-localstack#18. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Why
Salesforce clients typically call global describe (
/sobjects) before they can offer an object picker or browse schema, and read/limitsto show consumption. Neither was emulated, so those code paths 404'd and any tool exercising them couldn't be tested against sf-localstack.Found while building a terminal UI over the Salesforce APIs: object/field discovery was the first thing that couldn't run locally.
What
GET /services/data/{apiVersion}/sobjectskeyPrefix,custom,queryableand theurlsblock (sobject,describe,rowTemplate) that clients follow to per-object describes.GET /services/data/{apiVersion}/limitsMax/Remainingfor the commonly displayed limits. Record count drivesDataStorageMBand API consumption so the numbers track org state;Remainingis floored at 0.Both are read-only, mounted on the existing
/services/dataand/dataprefixes, and reflect the requestedapiVersionin generated URLs instead of hardcoding a version.Tests
5 new controller tests in
OrgApiControllerTest: baseline objects with URLs, custom objects appearing after a create, apiVersion reflected in URLs, limits shape, andRemainingstaying non-negative as records accumulate.Full suite green: 194 tests, 0 failures.
Not included
ApexLogandDeployRequest(Tooling) are still unemulated — they need new domain entities and seed data, so they're better as separate changes.🤖 Generated with Claude Code
https://claude.ai/code/session_01N7CzVfJLuZjCJeAnVqJ7HJ