mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-10-01 12:31:59 +00:00
ResolveSpec.Client (C#)
.NET 8 client for ResolveSpec (JSON body) and FunctionSpec. System.Text.Json, no other dependencies.
Not compiled or tested yet (no .NET SDK was available). Run
dotnet test tests/first.
Clients
| Type | Constructor | Methods |
|---|---|---|
ResolveSpecClient |
(baseUrl, ClientOptions?) |
GetMetadataAsync ReadAsync CreateAsync UpdateAsync DeleteAsync |
FuncSpecClient |
(baseUrl, ClientOptions?) |
QueryAsync QueryListAsync |
ClientOptions: Token, Headers, Timeout, HttpClient. Precedence: Content-Type < custom headers < bearer token.
ResolveSpec
id: int/long/string → URL,IEnumerable<string>→ body.Optionswith nullable properties; wire names viaJsonPropertyName.- Result:
Response{Success, Data (JsonElement), Metadata};resp.Decode<T>().
FunctionSpec
- Routes are server-defined: pass the
path. - Params (
IDictionary<string, object?>) → query string (enumerable → repeated keys, bool →true/false, null skipped). FuncSpecOptions→X-*headers:Filters,SearchFilters,CustomSqlWhere,CustomSqlOr,Sort,Limit,Offset,Distinct,SkipCount,SkipCache,ResponseFormat.QueryListAsyncfillsMetadatafromContent-Range; 206 is success.- Static helpers:
BuildHeaders,BuildQuery,EncodeHeaderValue,DecodeHeaderValue.
Server quirks
Sortis raw SQL in ORDER BY (client sendscol ASC|DESC).- One search operator per column.
- Values starting
ZIP_/__are base64-decoded by the server. - Non-ASCII, control chars and edge spaces are auto-encoded (
ZIP_).
Errors
ResolveSpecException{StatusCode, Message, Error{Code, Detail, Sql}}.
Test
dotnet test tests/