Commit 4cdae28
authored
OpenAPI: Fix and improve validation, resolve conflicts in endpoint descriptions (#835)
* Attempt to trigger OpenAPI validation at the end of the build
Move invocation to home.navigation.html and set high output format weight, add locks and debug printing for map in arangoproxy
There still appear to be openapi render hook calls after the validation, and Hugo reports the end of the build way before that
* OpenAPI Render Hook: Substitute version alias with version number to prevent duplicate invocations
This is only an issue for endpoint descriptions that contain internal links that get replaced with absolute URLs for api-docs.json / SwaggerUI. Hugo's caching of resources.GetRemote prevents duplicate calls arangoproxy's /openapi if the requests are identical
* Replace invocation of OpenAPI validation
It no longer gets triggered in live builds (hugo server) but only static builds, where we can reliably start the validation after the build
* Add debugging and validation for OpenAPI endpoints to find duplicate operationIds and conflicting endpoint descriptions
Note that identical endpoint descriptions for the same version are not considered an error (used for a few View endpoints on purpose). In fact, Hugo's caching of resources.GetRemote prevents arangoproxy from even getting called twice, which we take advantage of.
* Fix newly discovered conflicts between arangosearch and search-alias View endpoints and operationIds
* Revert addition of output format weight, use single curl HTTP method
arangoproxy's endpoints work with any method (HEAD, POST, ...) but using -I (HEAD) has the advantage that it only returns the HTTP headers
* Propagate validation errors to start_hugo.sh to let the pipeline fail if needed
Also add a temporary bug to an endpoint description for testing
* Propagate spec errors to CI
* Test duplicate operationId
* Remove a required property to cause swagger-cli to fail
* Revert removal of required property
* Reset error booleans1 parent c2d81b2 commit 4cdae28
File tree
10 files changed
+218
-57
lines changed- site
- content/arangodb
- 3.11/develop/http-api/views
- 3.12/develop/http-api/views
- 4.0/develop/http-api/views
- themes/arangodb-docs-theme/layouts
- _default
- _markup
- partials
- shortcodes
- toolchain
- arangoproxy/internal
- service
- scripts
10 files changed
+218
-57
lines changedLines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
1012 | 1012 | | |
1013 | 1013 | | |
1014 | 1014 | | |
1015 | | - | |
| 1015 | + | |
1016 | 1016 | | |
1017 | 1017 | | |
1018 | | - | |
| 1018 | + | |
1019 | 1019 | | |
1020 | 1020 | | |
1021 | 1021 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
1012 | 1012 | | |
1013 | 1013 | | |
1014 | 1014 | | |
1015 | | - | |
| 1015 | + | |
1016 | 1016 | | |
1017 | 1017 | | |
1018 | | - | |
| 1018 | + | |
1019 | 1019 | | |
1020 | 1020 | | |
1021 | 1021 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
1012 | 1012 | | |
1013 | 1013 | | |
1014 | 1014 | | |
1015 | | - | |
| 1015 | + | |
1016 | 1016 | | |
1017 | 1017 | | |
1018 | | - | |
| 1018 | + | |
1019 | 1019 | | |
1020 | 1020 | | |
1021 | 1021 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
Lines changed: 1 addition & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 32 | + | |
Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 0 additions & 6 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
| 130 | + | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
132 | 138 | | |
133 | 139 | | |
134 | 140 | | |
| |||
0 commit comments