Skip to content

Cpp generated code throws error for subscribe topics having more than 1 parameters #11

@explore-it

Description

@explore-it

Say, the asyncapi doc have more than 1 parameter in a subscribe topic. Sample topic mentioned at bottom.
Building the cpp generated code throws below error:

src/asyncapi_test_client.cpp:215:56: error: ‘errorType’ was not declared in this scope
  215 |                     _sendErrorCallback(device, errorType, inMsg);
 cmd/{device}/dm/get-{errorType}:
    description: The topic on which the device will receive a request to upload the specified error type.
    parameters:
      device:
        $ref: '#/components/parameters/device'
      errorType:
        $ref: '#/components/parameters/errorType'
    subscribe:
      operationId: sendError
      traits:
        - $ref: '#/components/operationTraits/mqtt'
      message:
        $ref: '#/components/messages/getErrorRequest'

Workaround - I have to manually edit the generated code to declare errorType and get it using FromString() in ReceiveMessage() of *_client.cpp. But adding a workaround creates chaos while regenerating the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions