Sparkle with XData module - and the expanded swagger docs

Hello,

I use an old way to create my Xdata-Server, like this:

SparkleServer := THttpSysServer.Create;
Module := TXDataServerModule.Create(mResource, TkshSQLConnection.CreatePool(20));
// ... configure the module
TXDataModelBuilder.LoadXmlDoc(Module.XModel);
// this works:
Module.XModel.Title := 'KSH WebAPI';
Module.XModel.Version := '1.0';
Module.XModel.Description := '...';

SparkleServer.AddModule(Module);
SparkleServer.Start;

With this code I cannot find the documentation in the swaggerUI. What do I have to do to include the documentation for services or methods or objects in the swaggerui?

Regards
Harald

It's described here and here.

In summary:

uses {...}, XData.OpenAPI.Service, XData.SwaggerUI.Service;

{...}
  RegisterOpenAPIService;
  RegisterSwaggerUIService;

Hello Wagner,

thank You for Your support. Your hint made me read the documentation over and over again - and that's when I found what was missing:

I have the xml documentation files in a subdirectory of my project and that's when I need the second parameter of the method:

TXDataModelBuilder.LoadXmlDoc(XDataServer.Model, 'C:\MyXMLFiles');

Now it works as expected. :slight_smile:

Thanks again
Harald

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.