OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
20.6k stars 6.29k forks source link

[C++] Using generated QT Client: How to know which response corresponds to which request? #18878

Open mjimenblazquez opened 4 weeks ago

mjimenblazquez commented 4 weeks ago

I have used the qt client generator for C++. I am using the generated api to make the request and connecting the the corresponding signal to obtain the response but as I have a lot of requests I need to find the way to know which response is the corresponding one to each request.

The definition of the request is the following one:

/object:
    post:
      operationId: addObject
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Object'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectId'          
        '400':
          description: Bad Request - Invalid input

the way I connect the signal is the following:

connect(&openApi_, &OpenAPI::Object::addObjectSignalFull, this,
            &addObjectSignalFull);

So I when I do the request:

openApi_.addObject(object1);
openApi_.addObject(object2);
openApi_.addObject(object3);

and I receive:

addObjectSignalEFull(worker, objectId_A);
addObjectSignalEFull(worker, objectId_B);
addObjectSignalEFull(worker, objectId_C);

how can I know to which object (object1, object2 o object3) corresponds, for example, the objectId_B

I will appreciate any help you can provide me.

Kindest regards