Cpp boost beast client redux

CW
8mo ago
+13022-1

C++ Boost Beast client code generator (take 2)

Minor updates to original PR#12197 by LukasWoodtli. Includes various fixes so that sample/integration tests succeed, including updates required due to ongoing changes in openapi-generator, as well as changes in the "imposter" tool used by the tests. Also, rebased to current HEAD of master branch.

Generated example code is committed under the samples directory and integration tests are also available there. To build the sample and run the tests within the devcontainer:

sudo apt update && sudo apt install libboost-all-dev cmake
curl -L https://raw.githubusercontent.com/imposter-project/imposter-cli/main/install/install_imposter.sh | sudo bash -
cd samples/client/petstore/cpp-boost-beast/
./build-and-test.bash

Note that once the samples are compiled, the test procedure will use imposter-cli to spin up a mock server based on the petstore.yaml, but with pre-scripted responses to various queries in the test program. Spinning up this server takes a bit of time, since on first invocation it has to docker pull a fairly large image: outofcoffee/imposter. Once the mock server is finally running, vscode will show a popup that the server is listening on port 8080, and then the test will (automatically) continue.

I don't want to take credit away from Lukas Woodtli, who did the original work on this PR. I resurrected it because I wanted to see a C++ generator that (a) did not depend on a now-retired library cpprestsdk, nor (b) require an Xserver to operate (the qt client links against the QT GUI library for some reason).

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in Git BASH)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@ravinikam
@stkrwork
@etherealjoy
@martindelille
@muttleyxd