elasticsearch-rs
elasticsearch-rs copied to clipboard
[DOCS] Client example documentation
Each official client has started to implement all of the console examples within the Elasticsearch reference documentation on the master
branch, with the aim to port the examples to a future "current" branch once a high number of the doc examples are implemented.
An example of the client doc examples is match query doc page. Switching to C# in a console example shows
Client examples should be implemented for the Rust client
Possible implementation
the approach to implementing the YAML rest spec test runner in #19 will likely require access to the ASTs used to generate the client, in order to construct correct client calls in generated test functions. Similarly, the client doc examples would be able to benefit from having access to the ASTs in order to generate correct client examples.
I can take this up if its ok to do so, I'm new to Rust, but have been using ES from 0.9.
@jubyvictor It might be good to hold off on this for now. The reference documentation is undergoing a fairly significant overhaul at the moment, so examples are changing quite frequently. If you're still interested once the reference documentation is in a better position, I can give you a ping. I think it'll be a fair amount of work to implement the general solution
- Read collected JSON examples from the alternative_reports.json
- Build the client APIs from the REST specs, similar to yaml_test_runner
- for each example, build the AST for the client call, and write to a file named
<digest>.asciidoc
This should be implemented as a binary, to allow it to be run on demand and as part of a CI process.
Aye aye captain !