You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**tl;dr:** mostly API calls will just-work as expected without knowing all the below notes (which elaborate mostly to-be-expected software-dev-commonplaces) — but in case of unexpected results or errors, they'll likely help.
218
-
___
219
-
This HTTP API has RPC rather than REST semantics. All operations are ´POST´, regardless of what CRUDs they might run (or not).
217
+
This HTTP API has RPC rather than REST semantics: **all** operations are ´POST´, regardless of what CRUD writes or reads they might or might not effect.
220
218
219
+
**tl;dr:** mostly **API calls will just-work as expected _without_ knowing all those intro notes** immediately below (which elaborate mostly to-be-expected software-dev-commonplaces),
220
+
- but in any cases of unexpected results or errors, they'll likely help complete the mental picture.
221
+
___
221
222
Our backend stack's convention-over-configuration designs yield a few request/response rules that remain **always in effect across all listed operations**:
222
223
- Whereas request and response bodies are operation-specific, all operations share the exact-same set of request headers, URL query-string parameters and response headers (albeit being elaborated here identically and redundantly for each individual operation).
223
224
- Request bodies **must never** be empty or the JSON ´null´: the empty request body is the JSON ´{}´.
@@ -229,13 +230,13 @@ Our backend stack's convention-over-configuration designs yield a few request/re
229
230
- Caution for some client languages: this means ´null´ for many-if-not-most empty JSON arrays (although ´[]´ is principally always just-as-possible) and empty JSON dictionary/hash-map "object"s (with either ´null´ or ´{}´ principally equally possible).
230
231
- All JSON object field names begin with an upper-case character,
231
232
- any example to the contrary indicates a "free-style" JSON dictionary/hash-map "object".
232
-
- The ´Content-Length´ request header is **required for all** operations.
233
+
- The ´Content-Length´ request header is **required for all** operations (with a correct value).
233
234
- The ´Content-Type´ request header is optional, but if present, must be correct with regards to both the operation's specification and the request body.
234
235
- Any ´multipart/form-data´ operations:
235
236
- **always require** the following two form-fields: ´files´ for any binary file uploads, and ´_´ for the actual JSON request payload;
236
237
- only the latter is elaborated in this doc, and always in the exact same way as done for all the ´application/json´ operations, **without** specifically mentioning the ´_´ form-field containing the ´text/plain´ of the full ´application/json´ request payload actually being elaborated here.
237
238
238
-
How to read request/response example JSON values rendered in this doc:
239
+
How to read request/response **example JSON values** rendered in this doc:
239
240
- ´true´ indicates any ´boolean´ value, regardless of the actual real value in a call;
240
241
- ´"someStr"´ indicates any ´string´ value;
241
242
- signed-integer ´number´s are indicated by a negative-number example indicating the minimum (type-wise, not operation-specific) permissible value, with the maximum being the corresponding positive-number counterpart;
@@ -245,13 +246,17 @@ How to read request/response example JSON values rendered in this doc:
245
246
- in responses, they're always UTC, whereas in requests, any timezone may be indicated;
246
247
- in requests, they may always be ´null´ (excepting any operation-specific known-errors indicating otherwise) but must never be ´""´ or otherwise non-RFC3339/ISO8601-parseable.
247
248
248
-
More about error responses:
249
+
About **error responses**:
249
250
- All are ´text/plain´.
250
251
- In addition to those listed in this doc (thrown by the service under the indicated conditions), other error responses are at all times entirely technically-possible and not exhaustively documentable (feasibly), such as eg. DB / file-system / network disruptions. Those caught by the service will be ´500´s, others (ie. from load-balancers / gateways / reverse-proxies etc. _in front of_ the service) might have _any_ HTTP status code whatsoever.
251
252
- All the well-known (thrown rather than caught) errors listed here:
252
253
- have their code-identifier-compatible (spaceless ASCII) enumerant-name as their entire text response, making all error responses inherently ´switch/case´able;
253
254
- have been recursively determined by code-path walking. Among them are some that logically could not possibly ever occur for that operation, yet identifying those (to filter them out of the listing) is (so far) out of scope for our ´openapi.json´ generation.
254
255
- Any non-known (caught rather than thrown) errors (not listed here) contain their original (usually human-language) error message fully, corresponding to the ´default´ in an error-handling ´switch/case´.
256
+
- "Not Found" rules:
257
+
- ´404´ **only** for HTTP requests of non-existing API operations or non-existing static-file assets,
258
+
- ´400´ for operations where existence was definitely expected (such as some object's update identified by its ´Id´),
259
+
- ´200´ with response-body of JSON ´null´ for requests of the "fetch single/first object found for some specified criteria" kind (where the definite-existence expectation does not necessarily hold).
255
260
`, str.Dict{"´": "`"}), str.Dict{})},
256
261
}
257
262
openapi.Info.Contact.Name, openapi.Info.Contact.Url="Permalink of "+filepath.Base(out_file_path), "https://"+Cfg.YO_APP_DOMAIN+"/"+StaticFilesDirName_App+"/"+filepath.Base(out_file_path)
0 commit comments