Skip to content

Commit b38011f

Browse files
authored
Re-add OpenAPI response content that was lost in migration (#368)
* Delete obsolete Python API docs generator * Migration script: More conservative strip and replace Preserve colons and additional paragraphs in API response descriptions * Add back colons and additional paragraphs to HTTP API responses that were lost * Mention current limitation of one paragraph per admonition in OpenAPI descriptions
1 parent 5a9bd51 commit b38011f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+986
-510
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,11 @@ paths:
344344
```
345345
````
346346

347+
For the OpenAPI JSON output, this is rendered as `> **WARNING:** ...`
348+
(a blockquote with the admonition type in bold and uppercase).
349+
Only a single paragraph is properly supported by the toolchain. Additional
350+
paragraphs will not be part of the blockquote.
351+
347352
Admonitions inside of other shortcodes need to use the special syntax, too:
348353

349354
```markdown

migration-tools/scripts/http_docublocks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def processHTTPDocuBlock(docuBlock, tag, headerLevel):
204204

205205
blocks = re.findall(r"(@RESTRETURNCODE\W.*?)(?=@RESTRETURNCODE|@ENDRESPONSES)", docuBlock, re.MULTILINE | re.DOTALL)
206206
for block in blocks:
207-
restReturnCode = re.search(r"@RESTRETURNCODE\W(.*?)(?=@|\n\n)", block, re.MULTILINE | re.DOTALL).group(0)
207+
restReturnCode = re.search(r"@RESTRETURNCODE\W(.*?)(?=\n@|\Z)", block, re.MULTILINE | re.DOTALL).group(0)
208208
try:
209209
currentRetStatus = processResponse(restReturnCode, newBlock["paths"][url][verb])
210210
except Exception as ex:
@@ -311,7 +311,7 @@ def processParameters(docuBlock, newBlock):
311311

312312
paramBlock["required"] = True if paramSplit[2] == "required" else False
313313

314-
paramBlock["description"] = "\n".join(docuBlock[1].split("\n")[1:]).replace(":", "") + "\n"
314+
paramBlock["description"] = "\n".join(docuBlock[1].split("\n")[1:]) + "\n"
315315
paramBlock["schema"] = {"type": paramSplit[1]}
316316
try:
317317
if paramSplit[3] != "" and not paramSplit[3] in swaggerBaseTypes:
@@ -372,8 +372,8 @@ def processRequestBody(docuBlock, newBlock):
372372
def processResponse(docuBlock, newBlock):
373373
blockSplit = docuBlock.split("\n")
374374
statusRE = re.search(r"\d+}", docuBlock).group(0)
375-
description = docuBlock.replace(statusRE, "").replace(":", "").replace("@RESTRETURNCODE{", "") + "\n"
376-
status = statusRE.replace("}", "")
375+
description = docuBlock.replace(statusRE, "").replace("@RESTRETURNCODE{", "") + "\n"
376+
status = statusRE.rstrip("}")
377377

378378
retBlock = {"description": description}
379379

migration-tools/scripts/inline_docublocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def migrateInlineDocuBlocks(block):
3535

3636
datasetRe = re.search(r"@DATASET.*", block)
3737
if datasetRe:
38-
newBlock["options"]["dataset"] = datasetRe.group(0).replace("@DATASET{", "").replace("}", "")
38+
newBlock["options"]["dataset"] = datasetRe.group(0).replace("@DATASET{", "").rstrip("}")
3939
block = re.sub(r" *@DATASET.*\n", '', block)
4040

4141
explainRe = re.search(r"@EXPLAIN\{TRUE\}.*", block)

site/content/3.10/develop/http-api/administration.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,11 @@ paths:
563563
description: |
564564
HTTP 503 will be returned in case the server is during startup or during shutdown,
565565
is set to read-only mode or is currently a follower in an Active Failover deployment setup.
566+
567+
In addition, HTTP 503 will be returned in case the fill grade of the scheduler
568+
queue exceeds the configured high-water mark (adjustable via startup option
569+
`--server.unavailability-queue-fill-grade`), which by default is set to 75 % of
570+
the maximum queue length.
566571
tags:
567572
- Administration
568573
```
@@ -875,7 +880,7 @@ paths:
875880
in: query
876881
required: false
877882
description: |
878-
<small>Introduced in v3.7.12, v3.8.1, v3.9.0</small>
883+
<small>Introduced in: v3.7.12, v3.8.1, v3.9.0</small>
879884
880885
If set to `true`, this initiates a soft shutdown. This is only available
881886
on Coordinators. When issued, the Coordinator tracks a number of ongoing
@@ -890,12 +895,12 @@ paths:
890895
requests will be handled by the remaining Coordinators, reducing the designated
891896
Coordinator's load.
892897
893-
The following types of operations are tracked
898+
The following types of operations are tracked:
894899
895900
- AQL cursors (in particular streaming cursors)
896901
- Transactions (in particular stream transactions)
897902
- Pregel runs (conducted by this Coordinator)
898-
- Ongoing asynchronous requests (using the `x-arango-async store` HTTP header)
903+
- Ongoing asynchronous requests (using the `x-arango-async: store` HTTP header)
899904
- Finished asynchronous requests, whose result has not yet been
900905
collected
901906
- Queued low priority requests (most normal requests)
@@ -1336,9 +1341,11 @@ paths:
13361341
the only attribute, and with the value being a string describing the
13371342
endpoint.
13381343
1339-
**Note**: retrieving the array of all endpoints is allowed in the system database
1344+
{{</* info */>}}
1345+
Retrieving the array of all endpoints is allowed in the system database
13401346
only. Calling this action in any other database will make the server return
13411347
an error.
1348+
{{</* /info */>}}
13421349
responses:
13431350
'200':
13441351
description: |

site/content/3.10/develop/http-api/collections.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ paths:
505505
responses:
506506
'200':
507507
description: |
508-
Returns information about the collection
508+
Returns information about the collection:
509509
content:
510510
application/json:
511511
schema:
@@ -615,7 +615,9 @@ paths:
615615
The response is a JSON object with a `shardId` attribute, which will
616616
contain the ID of the responsible shard.
617617
618-
**Note** : This method is only available in a cluster Coordinator.
618+
{{</* info */>}}
619+
This method is only available on Coordinators in cluster deployments.
620+
{{</* /info */>}}
619621
requestBody:
620622
content:
621623
application/json:
@@ -695,7 +697,9 @@ paths:
695697
shard IDs as object attribute keys, and the responsible servers for each shard mapped to them.
696698
In the detailed response, the leader shards will be first in the arrays.
697699
698-
**Note** : This method is only available in a cluster Coordinator.
700+
{{</* info */>}}
701+
This method is only available on Coordinators in cluster deployments.
702+
{{</* /info */>}}
699703
parameters:
700704
- name: collection-name
701705
in: path
@@ -858,7 +862,10 @@ paths:
858862
859863
By providing the optional query parameter `withData` with a value of `true`,
860864
the user-defined document attributes will be included in the calculation too.
861-
**Note**: Including user-defined attributes will make the checksumming slower.
865+
866+
{{</* info */>}}
867+
Including user-defined attributes will make the checksumming slower.
868+
{{</* /info */>}}
862869
863870
The response is a JSON object with the following attributes:
864871
@@ -1127,8 +1134,7 @@ paths:
11271134
numberOfShards:
11281135
description: |
11291136
(The default is `1`): in a cluster, this value determines the
1130-
number of shards to create for the collection. In a single
1131-
server setup, this option is meaningless.
1137+
number of shards to create for the collection.
11321138
type: integer
11331139
shardKeys:
11341140
description: |
@@ -1137,8 +1143,10 @@ paths:
11371143
Documents are sent to shards based on the values of their shard key attributes.
11381144
The values of all shard key attributes in a document are hashed,
11391145
and the hash value is used to determine the target shard.
1140-
**Note**: Values of shard key attributes cannot be changed once set.
1141-
This option is meaningless in a single server setup.
1146+
1147+
{{</* info */>}}
1148+
The values of shard key attributes cannot be changed once set.
1149+
{{</* /info */>}}
11421150
type: string
11431151
replicationFactor:
11441152
description: |
@@ -1212,11 +1220,13 @@ paths:
12121220
12131221
The default is `""`.
12141222
1215-
**Note**: Using this parameter has consequences for the prototype
1223+
{{</* info */>}}
1224+
Using this parameter has consequences for the prototype
12161225
collection. It can no longer be dropped, before the sharding-imitating
12171226
collections are dropped. Equally, backups and restores of imitating
12181227
collections alone generate warnings (which can be overridden)
12191228
about a missing sharding prototype.
1229+
{{</* /info */>}}
12201230
type: string
12211231
isSmart:
12221232
description: |
@@ -1684,7 +1694,7 @@ paths:
16841694
required: false
16851695
description: |
16861696
If `true` then the data is synchronized to disk before returning from the
1687-
truncate operation (default `false`)
1697+
truncate operation (default: `false`)
16881698
schema:
16891699
type: boolean
16901700
- name: compact
@@ -2164,7 +2174,9 @@ paths:
21642174
If renaming the collection succeeds, then the collection is also renamed in
21652175
all graph definitions inside the `_graphs` collection in the current database.
21662176
2167-
**Note**: this method is not available in a cluster.
2177+
{{</* info */>}}
2178+
Renaming collections is not supported in cluster deployments.
2179+
{{</* /info */>}}
21682180
parameters:
21692181
- name: collection-name
21702182
in: path

site/content/3.10/develop/http-api/databases.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ paths:
153153
description: |
154154
Retrieves the list of all existing databases
155155
156-
**Note**: retrieving the list of databases is only possible from within the `_system` database.
156+
{{</* info */>}}
157+
Retrieving the list of databases is only possible from within the `_system` database.
158+
{{</* /info */>}}
157159
responses:
158160
'200':
159161
description: |
@@ -195,7 +197,9 @@ paths:
195197
196198
The response is a JSON object with the attribute `result` set to `true`.
197199
198-
**Note**: Creating a new database is only possible from within the `_system` database.
200+
{{</* info */>}}
201+
Creating a new database is only possible from within the `_system` database.
202+
{{</* /info */>}}
199203
requestBody:
200204
content:
201205
application/json:
@@ -374,8 +378,10 @@ paths:
374378
description: |
375379
Drops the database along with all data stored in it.
376380
377-
**Note**: dropping a database is only possible from within the `_system` database.
381+
{{</* info */>}}
382+
Dropping a database is only possible from within the `_system` database.
378383
The `_system` database itself cannot be dropped.
384+
{{</* /info */>}}
379385
parameters:
380386
- name: database-name
381387
in: path

site/content/3.10/develop/http-api/documents.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -435,21 +435,21 @@ paths:
435435
in: query
436436
required: false
437437
description: |
438-
This option supersedes `overwrite` and offers the following modes
439-
- `"ignore"` if a document with the specified `_key` value exists already,
438+
This option supersedes `overwrite` and offers the following modes:
439+
- `"ignore"`: if a document with the specified `_key` value exists already,
440440
nothing is done and no write operation is carried out. The
441441
insert operation returns success in this case. This mode does not
442442
support returning the old document version using `RETURN OLD`. When using
443443
`RETURN NEW`, `null` is returned in case the document already existed.
444-
- `"replace"` if a document with the specified `_key` value exists already,
444+
- `"replace"`: if a document with the specified `_key` value exists already,
445445
it is overwritten with the specified document value. This mode is
446446
also used when no overwrite mode is specified but the `overwrite`
447447
flag is set to `true`.
448-
- `"update"` if a document with the specified `_key` value exists already,
448+
- `"update"`: if a document with the specified `_key` value exists already,
449449
it is patched (partially updated) with the specified document value.
450450
The overwrite mode can be further controlled via the `keepNull` and
451451
`mergeObjects` parameters.
452-
- `"conflict"` if a document with the specified `_key` value exists already,
452+
- `"conflict"`: if a document with the specified `_key` value exists already,
453453
return a unique constraint violation error so that the insert operation
454454
fails. This is also the default behavior in case the overwrite mode is
455455
not set, and the `overwrite` flag is `false` or not set either.
@@ -1473,7 +1473,7 @@ paths:
14731473
in: query
14741474
required: false
14751475
description: |
1476-
Should the value be `true` (the default)
1476+
Should the value be `true` (the default):
14771477
If a search document contains a value for the `_rev` field,
14781478
then the document is only returned if it has the same revision value.
14791479
Otherwise a precondition failed error is returned.
@@ -1673,21 +1673,21 @@ paths:
16731673
in: query
16741674
required: false
16751675
description: |
1676-
This option supersedes `overwrite` and offers the following modes
1677-
- `"ignore"` if a document with the specified `_key` value exists already,
1676+
This option supersedes `overwrite` and offers the following modes:
1677+
- `"ignore"`: if a document with the specified `_key` value exists already,
16781678
nothing is done and no write operation is carried out. The
16791679
insert operation returns success in this case. This mode does not
16801680
support returning the old document version using `RETURN OLD`. When using
16811681
`RETURN NEW`, `null` is returned in case the document already existed.
1682-
- `"replace"` if a document with the specified `_key` value exists already,
1682+
- `"replace"`: if a document with the specified `_key` value exists already,
16831683
it is overwritten with the specified document value. This mode is
16841684
also used when no overwrite mode is specified but the `overwrite`
16851685
flag is set to `true`.
1686-
- `"update"` if a document with the specified `_key` value exists already,
1686+
- `"update"`: if a document with the specified `_key` value exists already,
16871687
it is patched (partially updated) with the specified document value.
16881688
The overwrite mode can be further controlled via the `keepNull` and
16891689
`mergeObjects` parameters.
1690-
- `"conflict"` if a document with the specified `_key` value exists already,
1690+
- `"conflict"`: if a document with the specified `_key` value exists already,
16911691
return a unique constraint violation error so that the insert operation
16921692
fails. This is also the default behavior in case the overwrite mode is
16931693
not set, and the `overwrite` flag is `false` or not set either.

0 commit comments

Comments
 (0)