Definitions for complex types not found on the API generated by the HTTP API dispatcher

Hello,

I have an app that uses the HTTP API Dispatcher to handle REST clients.

My services and types are divided in two RODL files: the services one and the types one, which is referenced by the first one. I don’t have the “Generate Code for the definitions in this RODL file” check enabled on my services RODL, mostly because that negates the advantage/workaround for having the two separated: I originally had all my types and services on the same RODL, but the resulting files from time to time made C++Builder choke, so I started splitting the contents several months/years ago and haven’t looked back.

So, my problem now is that the swagger API generated by RO doesn’t include the type definitions anywhere. Just the reference, for instance:

  /catalogos/cliente/id/{ClienteId}:
    get:
      tags:
        - Catalogos
        - Clientes
      parameters:
        - name: ClienteId
          in: path
          required: true
          type: integer
          format: int32
      responses:
        '200':
          description: The method call completed successfully
          schema:
            $ref: '#/definitions/TClienteTS4'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
      security:
        - Bearer: []

But on the JSON generated by the server there is no definition anywhere for TClienteTS4.

I don’t know if there is some setting I am missing or something like that? I believe before (some months ago?) that info was included, but I don’t know if I misconfigured something (can’t see anything that could imply to control that anywhere) or if this is a bug on the newer RO versions. I am on 1571. Version 1559 also works like this, but probably version 1555 did produce the API with the definitions included (I don’t have right now an easy way to try this, but for the time when I updated to the newer versions, I think it did)

I have tried with the IndyHTTP Server and the ROHTTP server, both produce the same.

The RODFILE.res is being generated by the IDE hookups, so it contains correctly both RODL files.

Any ideas?

Hi,

Can you share your RODLs, pls?
I’ll review what is wrong

You can drop email to support@ for keeping privacy

Thanks Evgeny,

I’ve sent the files by email.

Hi,

update uRORTTIServerSupport.pas as

procedure TRORTTIRODLReader.DoProcess(aLibrary: TRODLLibrary; aServiceGroup: string = '');
...
  for I := 0 to aLibrary.UseCount - 1 do   // added
    aLibrary.Use[i].Merged := False;       //added
  {$ENDIF}
end;

or put {$UNDEF CodeFirst_Use_RODL_Uses} into RemObjects_user.inc

don’t forget to relaunch C:\Program Files (x86)\RemObjects Software\Build\install_RO.cmd (or install_DA.cmd) with admin rights.

Logged as bugs://D19396.

bugs://D19396 was closed as fixed.

Thank you. I went the UNDEF route and all is working as expected. I’ll wait for the next update to remove the UNDEF, I guess the code fix will be already included at that point.

Regards