I’ve previously written about the OpenSearch OpenAPI Specification.
One of the neat features of the API spec repo is a set of declarative YAML integration tests. This turned out to be really useful in fixing bugs in the OpenSearch API reference documentation that is published to opensearch.org.
Here’s how I went about it.
To author tests, I started with reading the API documentation. For example, I read the docs for /_refresh
, and added tests for that API in opensearch-api-specification#374.
The basic example that refreshes all indices was easy.
Then, I tried using the query parameters.
This failed.
The failure is with the expand_wildcard
parameter, which is misspelled and should be expand_wildcards
.
The corrected test passes.
All we have left is to fix the documentation in documentation-website#7620. I also fixed a bug in PUT mapping
in documentation-website#7652 and corrected the type of include_defaults
in GET /_settings
in documentation-website#7657.
Finally, we’d like to generate a lot of the documentation from spec in documentation-website#7700.