Fossil SCM

(Typos) www/json/conventions.md - Various fixes.

brickviking 2024-10-28 09:48 bv-corrections01
Commit 9d9193fd4db6cdbc386e148b026e284bf0a96cd1e624687b9ee68eb65a1c8550
1 file changed +8 -8
--- www/json-api/conventions.md
+++ www/json-api/conventions.md
@@ -100,11 +100,11 @@
100100
101101
The API allows most of those (normally all but the payload) to come in
102102
as either GET parameters or properties of the top-level POSTed request
103103
JSON envelope, with GET taking priority over POST. (Reminder to self: we
104104
could potentially also use values from cookies. Fossil currently only
105
-uses 1 cookie (the login token), and i'd prefer to keep it that way.)
105
+uses 1 cookie (the login token), and I'd prefer to keep it that way.)
106106
107107
POST requests without such an envelope will be rejected, generating a
108108
Fossil/JSON error response (as opposed to an HTTP error response). GET
109109
requests, by definition, never have an envelope.
110110
@@ -169,11 +169,11 @@
169169
No higher-level constructs, e.g. JSON **arrays** or **objects**, are
170170
accepted in string form. Such parameters must be set in the POST
171171
envelope or payload, as specified by the specific API.
172172
173173
This API does not currently use any **floating-point** parameters, but
174
-does return floating-point results in a couple places.
174
+does return floating-point results in a couple of places.
175175
176176
For **integer** parameters we use a conventional string-to-int algorithm
177177
and assume base 10 (analog to atoi(3)). The API may err on the side of
178178
usability when given technically invalid values. e.g. "123abc" will
179179
likely be interpreted as the integer 123. No APIs currently rely on
@@ -205,11 +205,11 @@
205205
cause inconsistencies vis-a-vis the HTML interface).
206206
207207
<a id="response-envelope"></a>
208208
# Response Envelope
209209
210
-Every response comes in the form of a HTTP response or (in CLI mode)
210
+Every response comes in the form of an HTTP response or (in CLI mode)
211211
JSON sent to stdout. The body of the response is a JSON object following
212212
a common envelope format. The envelope has the following properties:
213213
214214
215215
- `fossil`: Fossil server version string. This property is basically
@@ -216,11 +216,11 @@
216216
"the official response envelope marker" - if it is set, clients can
217217
"probably safely assume" that the object indeed came from one of the
218218
Fossil/JSON APIs. This API never creates responses which do not
219219
contain this property.
220220
- `requestId`: Only set if the request contained it, and then it is
221
- echoed back to the caller as-is. This can be use to determine
221
+ echoed back to the caller as-is. This can be used to determine
222222
(client-side) which request a given response is coming in for
223223
(assuming multiple asynchronous requests are pending). In practice
224224
this generally isn’t needed because response handling tends to be
225225
done by closures associated with the original request object (at
226226
least in JavaScript code). In languages without closures it might
@@ -235,11 +235,11 @@
235235
- `payload`: Request-specific response payload (data type/structure is
236236
request-specific). The payload is never set for error responses,
237237
only for success responses (and only those which actually have a
238238
payload - not all do).
239239
- `timestamp`: Response timestamp (GMT Unix Epoch). We use seconds
240
- precision because i did not know at the time that Fossil actually
240
+ precision because I did not know at the time that Fossil actually
241241
records millisecond precision.
242242
- `payloadVersion`: Not initially needed, but reserved for future use
243243
in maintaining version compatibility when the format of a given
244244
response type's payload changes. If needed, the "first version"
245245
value is assumed to be 0, for semantic [near-]compatibility with the
@@ -402,11 +402,11 @@
402402
(they are represented by `\t`) there is no chance that such a global
403403
replacement will corrupt JSON string contents - only the formatting will
404404
be affected.
405405
406406
Potential TODO: because extraneous indention "could potentially" be used
407
-as a form DoS, the option *might* be subject to later removed from HTTP
407
+as a form of DoS, the option *might* be subject to later removal from HTTP
408408
mode (in CLI it's fine).
409409
410410
In HTTP mode no trailing newline is added to the output, whereas in CLI
411411
mode one is normally appended (exception: in JSONP mode no newline is
412412
appended, to (rather pedantically and arbitraily) allow the client to
@@ -482,11 +482,11 @@
482482
normally want to see very specific error codes when tracking down a
483483
problem. We can offer a configuration option to "dumb down" error
484484
codes to their generic category by simply doing a modulo 100
485485
(or 1000) against the native error code number. e.g. FOSSIL-1271
486486
could (via a simple modulo) be reduced to FOSSIL-1200 or
487
- FOSSIL-1000, depending on the paranoia level of the sysadmin. i have
487
+ FOSSIL-1000, depending on the paranoia level of the sysadmin. I have
488488
tried to order the result code numbers so that a dumb-down level of
489489
2 provides reasonably usable results without giving away too much
490490
detail to malicious clients.\
491491
(**TODO:** `g.json.errorDetailParanoia` is used to set the
492492
default dumb-down level, but it is currently set at compile-time.
@@ -533,11 +533,11 @@
533533
can actually implement this one, though.)
534534
- `FOSSIL-1106`: Assertion failed (or would have had we
535535
continued). Note: if an `assert()` fails in CGI/server modes, the HTTP
536536
response will be code 500 (Internal Server Error). We want to avoid
537537
that and return a JSON response instead. All of that said - there seems
538
- to be little reason to implementi this, since assertions are "truly
538
+ to be little reason to implement this, since assertions are "truly
539539
serious" errors.
540540
- `FOSSIL-1107`: Allocation/out of memory error. This cannot be reasonably
541541
reported because fossil aborts if an allocation fails.
542542
- `FOSSIL-1108`: Requested API is not yet implemented.
543543
- `FOSSIL-1109`: Panic! Fossil's `fossil_panic()` or `cgi_panic()` was
544544
--- www/json-api/conventions.md
+++ www/json-api/conventions.md
@@ -100,11 +100,11 @@
100
101 The API allows most of those (normally all but the payload) to come in
102 as either GET parameters or properties of the top-level POSTed request
103 JSON envelope, with GET taking priority over POST. (Reminder to self: we
104 could potentially also use values from cookies. Fossil currently only
105 uses 1 cookie (the login token), and i'd prefer to keep it that way.)
106
107 POST requests without such an envelope will be rejected, generating a
108 Fossil/JSON error response (as opposed to an HTTP error response). GET
109 requests, by definition, never have an envelope.
110
@@ -169,11 +169,11 @@
169 No higher-level constructs, e.g. JSON **arrays** or **objects**, are
170 accepted in string form. Such parameters must be set in the POST
171 envelope or payload, as specified by the specific API.
172
173 This API does not currently use any **floating-point** parameters, but
174 does return floating-point results in a couple places.
175
176 For **integer** parameters we use a conventional string-to-int algorithm
177 and assume base 10 (analog to atoi(3)). The API may err on the side of
178 usability when given technically invalid values. e.g. "123abc" will
179 likely be interpreted as the integer 123. No APIs currently rely on
@@ -205,11 +205,11 @@
205 cause inconsistencies vis-a-vis the HTML interface).
206
207 <a id="response-envelope"></a>
208 # Response Envelope
209
210 Every response comes in the form of a HTTP response or (in CLI mode)
211 JSON sent to stdout. The body of the response is a JSON object following
212 a common envelope format. The envelope has the following properties:
213
214
215 - `fossil`: Fossil server version string. This property is basically
@@ -216,11 +216,11 @@
216 "the official response envelope marker" - if it is set, clients can
217 "probably safely assume" that the object indeed came from one of the
218 Fossil/JSON APIs. This API never creates responses which do not
219 contain this property.
220 - `requestId`: Only set if the request contained it, and then it is
221 echoed back to the caller as-is. This can be use to determine
222 (client-side) which request a given response is coming in for
223 (assuming multiple asynchronous requests are pending). In practice
224 this generally isn’t needed because response handling tends to be
225 done by closures associated with the original request object (at
226 least in JavaScript code). In languages without closures it might
@@ -235,11 +235,11 @@
235 - `payload`: Request-specific response payload (data type/structure is
236 request-specific). The payload is never set for error responses,
237 only for success responses (and only those which actually have a
238 payload - not all do).
239 - `timestamp`: Response timestamp (GMT Unix Epoch). We use seconds
240 precision because i did not know at the time that Fossil actually
241 records millisecond precision.
242 - `payloadVersion`: Not initially needed, but reserved for future use
243 in maintaining version compatibility when the format of a given
244 response type's payload changes. If needed, the "first version"
245 value is assumed to be 0, for semantic [near-]compatibility with the
@@ -402,11 +402,11 @@
402 (they are represented by `\t`) there is no chance that such a global
403 replacement will corrupt JSON string contents - only the formatting will
404 be affected.
405
406 Potential TODO: because extraneous indention "could potentially" be used
407 as a form DoS, the option *might* be subject to later removed from HTTP
408 mode (in CLI it's fine).
409
410 In HTTP mode no trailing newline is added to the output, whereas in CLI
411 mode one is normally appended (exception: in JSONP mode no newline is
412 appended, to (rather pedantically and arbitraily) allow the client to
@@ -482,11 +482,11 @@
482 normally want to see very specific error codes when tracking down a
483 problem. We can offer a configuration option to "dumb down" error
484 codes to their generic category by simply doing a modulo 100
485 (or 1000) against the native error code number. e.g. FOSSIL-1271
486 could (via a simple modulo) be reduced to FOSSIL-1200 or
487 FOSSIL-1000, depending on the paranoia level of the sysadmin. i have
488 tried to order the result code numbers so that a dumb-down level of
489 2 provides reasonably usable results without giving away too much
490 detail to malicious clients.\
491 (**TODO:** `g.json.errorDetailParanoia` is used to set the
492 default dumb-down level, but it is currently set at compile-time.
@@ -533,11 +533,11 @@
533 can actually implement this one, though.)
534 - `FOSSIL-1106`: Assertion failed (or would have had we
535 continued). Note: if an `assert()` fails in CGI/server modes, the HTTP
536 response will be code 500 (Internal Server Error). We want to avoid
537 that and return a JSON response instead. All of that said - there seems
538 to be little reason to implementi this, since assertions are "truly
539 serious" errors.
540 - `FOSSIL-1107`: Allocation/out of memory error. This cannot be reasonably
541 reported because fossil aborts if an allocation fails.
542 - `FOSSIL-1108`: Requested API is not yet implemented.
543 - `FOSSIL-1109`: Panic! Fossil's `fossil_panic()` or `cgi_panic()` was
544
--- www/json-api/conventions.md
+++ www/json-api/conventions.md
@@ -100,11 +100,11 @@
100
101 The API allows most of those (normally all but the payload) to come in
102 as either GET parameters or properties of the top-level POSTed request
103 JSON envelope, with GET taking priority over POST. (Reminder to self: we
104 could potentially also use values from cookies. Fossil currently only
105 uses 1 cookie (the login token), and I'd prefer to keep it that way.)
106
107 POST requests without such an envelope will be rejected, generating a
108 Fossil/JSON error response (as opposed to an HTTP error response). GET
109 requests, by definition, never have an envelope.
110
@@ -169,11 +169,11 @@
169 No higher-level constructs, e.g. JSON **arrays** or **objects**, are
170 accepted in string form. Such parameters must be set in the POST
171 envelope or payload, as specified by the specific API.
172
173 This API does not currently use any **floating-point** parameters, but
174 does return floating-point results in a couple of places.
175
176 For **integer** parameters we use a conventional string-to-int algorithm
177 and assume base 10 (analog to atoi(3)). The API may err on the side of
178 usability when given technically invalid values. e.g. "123abc" will
179 likely be interpreted as the integer 123. No APIs currently rely on
@@ -205,11 +205,11 @@
205 cause inconsistencies vis-a-vis the HTML interface).
206
207 <a id="response-envelope"></a>
208 # Response Envelope
209
210 Every response comes in the form of an HTTP response or (in CLI mode)
211 JSON sent to stdout. The body of the response is a JSON object following
212 a common envelope format. The envelope has the following properties:
213
214
215 - `fossil`: Fossil server version string. This property is basically
@@ -216,11 +216,11 @@
216 "the official response envelope marker" - if it is set, clients can
217 "probably safely assume" that the object indeed came from one of the
218 Fossil/JSON APIs. This API never creates responses which do not
219 contain this property.
220 - `requestId`: Only set if the request contained it, and then it is
221 echoed back to the caller as-is. This can be used to determine
222 (client-side) which request a given response is coming in for
223 (assuming multiple asynchronous requests are pending). In practice
224 this generally isn’t needed because response handling tends to be
225 done by closures associated with the original request object (at
226 least in JavaScript code). In languages without closures it might
@@ -235,11 +235,11 @@
235 - `payload`: Request-specific response payload (data type/structure is
236 request-specific). The payload is never set for error responses,
237 only for success responses (and only those which actually have a
238 payload - not all do).
239 - `timestamp`: Response timestamp (GMT Unix Epoch). We use seconds
240 precision because I did not know at the time that Fossil actually
241 records millisecond precision.
242 - `payloadVersion`: Not initially needed, but reserved for future use
243 in maintaining version compatibility when the format of a given
244 response type's payload changes. If needed, the "first version"
245 value is assumed to be 0, for semantic [near-]compatibility with the
@@ -402,11 +402,11 @@
402 (they are represented by `\t`) there is no chance that such a global
403 replacement will corrupt JSON string contents - only the formatting will
404 be affected.
405
406 Potential TODO: because extraneous indention "could potentially" be used
407 as a form of DoS, the option *might* be subject to later removal from HTTP
408 mode (in CLI it's fine).
409
410 In HTTP mode no trailing newline is added to the output, whereas in CLI
411 mode one is normally appended (exception: in JSONP mode no newline is
412 appended, to (rather pedantically and arbitraily) allow the client to
@@ -482,11 +482,11 @@
482 normally want to see very specific error codes when tracking down a
483 problem. We can offer a configuration option to "dumb down" error
484 codes to their generic category by simply doing a modulo 100
485 (or 1000) against the native error code number. e.g. FOSSIL-1271
486 could (via a simple modulo) be reduced to FOSSIL-1200 or
487 FOSSIL-1000, depending on the paranoia level of the sysadmin. I have
488 tried to order the result code numbers so that a dumb-down level of
489 2 provides reasonably usable results without giving away too much
490 detail to malicious clients.\
491 (**TODO:** `g.json.errorDetailParanoia` is used to set the
492 default dumb-down level, but it is currently set at compile-time.
@@ -533,11 +533,11 @@
533 can actually implement this one, though.)
534 - `FOSSIL-1106`: Assertion failed (or would have had we
535 continued). Note: if an `assert()` fails in CGI/server modes, the HTTP
536 response will be code 500 (Internal Server Error). We want to avoid
537 that and return a JSON response instead. All of that said - there seems
538 to be little reason to implement this, since assertions are "truly
539 serious" errors.
540 - `FOSSIL-1107`: Allocation/out of memory error. This cannot be reasonably
541 reported because fossil aborts if an allocation fails.
542 - `FOSSIL-1108`: Requested API is not yet implemented.
543 - `FOSSIL-1109`: Panic! Fossil's `fossil_panic()` or `cgi_panic()` was
544

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button