Hi Paul there isn’t much of a getting-started guide for QT but there should be one. Maybe you can help with a PR to the repository?
Getting started should be simple, but here’s a quick tutorial to help out.
* Upon generation, you will have a set of files created—the ones ending in “Api” are the classes used to call the server. Every method in there corresponds, through “operationId” in your spec and includes the parameters for calling it
* A Model class is created for each schema definition in your swagger file. These are input/outputs for the calls to the api classes
* Each API call executes a function which calls back to a slot in your application. To receive the callback, you’ll need to connect your listener to the appropriate callback.
For example this sample client:
To get a “pet by ID” you would
* include SWGPetApi.h in your class making the call
* instantiate the SWGPetApi class like such:
SWGPetApi * api = new SWGPetApi();
* Connect the SWGPetApi instance to your app like such:
this->connect(api, getPetByIdSignal(SWGPet*), this, getPetCallback(SWGPet* pet)
* Call the getPetById(qint64 pet_id); method
* Your function “getPetByIdCallback(SWGPet* pet)” will be called by the api class
There are some other convenience features, such as serializing the models to JSON and back, for example you can write a model to JSON like this:
SWGPet pet;
pet.setId(300);
qDebug() << pet.asJson();
and also instantiate objects from json:
QString json("{\"id\":3}");
// populate the object from JSON
pet.fromJson(json);
etc.
Tony