All Aurelius access to object through xData are working fine, but access to swaggerui isn't working.
Same project as dll for Apache Windows is working without error and presents swaggerui wihtout error.
To test if it was due to my xData implementation with quite complex Aurelius and Service Contracts.
I created a new simple project with a simple Service Contract
But unfortunately I get the same error about SwaggerUI access. If I'm right I didn't get this error in a previous test project I made 6-9 month ago.
Unit I use for service contract :
unit unit_test_svc;
interface
uses
Generics.Collections,
XData.Service.Common;
Type
TInfoVersion = Class
version : string;
name : string;
copyright : string;
End;
[ServiceContract]
[Route('version')]
IInfoService = interface(IInvokable)
['{36A9ADF9-E9B1-430F-BD6D-36B354CAC931}']
[HttpGet]
function InfoVersion : TInfoVersion;
end;
implementation
initialization
RegisterServiceType(TypeInfo(IInfoService));
end.
This usually happen you can register Swagger/SwaggerUI twice:
You are calling RegisterOpenApiService method in your application;
and
You have set property Swagger.Enabled to True in your TXDataServer component.
If you are using the design-time TXDataServer, just enable the properties in object inspector and don't call either RegisterOpenApiService or RegisterSwaggerUIService.
None call to RegisterOpenApiService method, only properties set into object inspector.
Code is working well when is a DLL of Windows Apache, but not as SO for Linux Apache.
Thank you. We were able to reproduce and fix it. Fix will be included in next release.
For now, the workaround is to disable the Swagger properties in the TXDataServer component.