What's New
Version 5.17 (Mar-2024)
- New: ConnectionPoolDebugger demo shows advanced techniques for detecting problems in the connection pool, like dumping current pool status and logging connections that are held for too long.
Version 5.16 (Jan-2024)
- Fixed: Added missing template files for TMS XData Web Application wizard (regression).
Version 5.15 (Nov-2023)
- Fixed: Delphi 12 specific issue, JSON serialization of numbers was serializing integers ending with ".0" due to a change in JSON serialization behavior in Delphi 12.
Version 5.14 (Nov-2023)
- New: Delphi 12 Support.
Version 5.13 (Oct-2023)
New: Redoc support provides an endpoint to get your API documentation automatically using Redoc tool.
New: OpenAPI document now includes validation rules specified in some validation attributes like
Range
,MaxLength
andMinLength
.New: Support for tag groups in Redoc allowing a higher-level organization of your endpoints.
Improved:
TXDataWebDataset
propertiesIndexed
,Activeindex
,Filter
andFiltered
now appearing in object inspector.Improved: Support for ARM64 macOS and ARM64 iOS Simulator platforms.
Improved: Generated Swagger/OpenAPI document now includes extension x-nullable property for nullable types.
Version 5.12 (Jul-2023)
New: Entities now can be excluded from Swagger document by using
SwaggerExclude
attribute. Request #19337.New:
IObjectPool
interface with methodGetPoolInfo
. XData pool interfaces implement it.New: Swagger configuration variables allow redirecting URL of Swagger JS libraries to a different server.
Improved:
XDefault
attribute now can be used forTGUID
parameters. Feature Request #20419.Improved: New
TUserClaim
propertiesIsBoolean
,IsNull
andIsDouble
. Feature Request #20420.Improved: Multi-tenancy demo updated to use Tenant middleware and
TXDataMultiDBConnectionPool
.Improved: URL conventions now accepts date-only and time-only literals, in addition to full "date and time" literals. Request #20872.
Improved: ISO times now are accepted if milliseconds part has from 1 to 8 digits.
Fixed:
TXDataClient
raising "not found" exceptions when retrieving lazy-loading proxied associations. It should silently return and set the proxy as nil. Ticket #20754.Fixed:
TXDataWebConnection.SendRequestAsync
not returning a validIHttpResponse
interface. Ticket #20688.Fixed: Queries in automatic CRUD endpoints could not include both
$select
and$inlinecount
clauses in the same query.Ticket #20434.
Version 5.11 (Feb-2023)
New: Automatic parameter validation. You can now apply validation attributes to parameters and DTO classes to make sure you receive parameters and classes with the expected values.
New: It's now possible to flag an endpoint as deprecated in Swagger, using XML comment
<swagger name="deprecated" />
.New:
[XDefault]
attribute can be applied to fields and properties and they will be used for the purpose of Swagger documentation.Improved:
TXDataClient
now shows detailed error message in exception when the response is a standard OAuth 2 error response.fImproved:
Range
attribute now also applies to float values (in addition to integer values).Fixed: Memory leak when an associated object in a JSON deserialization was being deserialized as nil. If such object was previously created, it would leak. Now, XData will destroy the previous object if it's flagged with JsonManaged attribute.
Fixed: Web Core stub code for TUpdateStatus had invalid enumerated values. Ticket 20095.
Version 5.10 (Jan-2023)
Improved: Built-in validators now generate validation error messages with more specific error codes (for example,
ValueRequired
orValueTooLong
instead ofValidationError
).Improved: Validator attributes now can receive an option ErrorCode parameter in their constructors.
Improved: DTO validation messages now inform the full path of the property causing the error. For example, instead of "field name must be required", it shows "field country.name must be required", or "field customers[1].country.name must be required".
Improved: Better error message (
InsufficientPermission
) when and endpoint is not authorized.Improved: Correct response status code (400) and better error message for invalid parameter values sent via URL, including indicating the name of the offending parameter. For example: Cannot deserialize value "x" from Url parameter "NumericId".
Fixed: Deserialization of date time from JSON were raising wrong exceptions (Invalid argument to date encode) for wrong date value, like "7777".
Version 5.9 (Dec-2022)
New: TXDataConnectionPool.OnDBConnectionRelease event.
New: XDefaultNil attribute to allow optional object (DTO) parameters.
Improved: TXDataWebClient.RawInvoke now accepts query string.
Improved: WebCoreBlobClient demo now shows how to retrieve an image blob from server using AJAX requests.
Improved: Error message for JSON Schema generator now shows the position of JSON document which caused the error.
Improved: Incomplete JSON request bodies sent by the client now return HTTP status code 400 (instead of 500).
Improved: Web master-detail demo updated with more functionality.
Improved: Better error message ("Missing parameter" instead of "Invalid JSON") when the endpoint expects a single object parameter but no content body is sent.
Improved: If all body parameters of an endpoint are optional (have default values), then Swagger specification is not adding the single body parameter as required.
Fixed: Web music demo was failing after login with "401 unauthorized" error.
Fixed: Deserialization of date time from JSON were raising wrong exceptions (Invalid argument to date encode) for wrong date/time values, like "7777".
Version 5.8 (Sep-2022)
Improved: URL/Query parameter not flagged as required in Swagger UI, when such parameter comes from a DTO property (a DTO flagged with
FromQuery
attribute).Improved: Design-time components were greyed out in component palette if current platform was different than Win32.
Fixed: Swagger documentation for DTO members were not being displayed when if the members were declared in an ancestor class.
Fixed: Some wrong JSON request bodies were still causing status code in response to be 500 instead of 400.
Fixed: Some Access Violation error when lists were nil in DTOs.
Fixed:
TXDataClient
not retrieving error message details in some situations (error 404 for services that didn't return objects)Fixed: Service operations flagged as
www-form-urlencoded
were not decoding the plus sign (+) as spaces from request body.
Version 5.7 (Aug-2022)
New: OpenAPI Importer is removed and became OpenAPI Delphi Generator, which is now open source: https://github.com/landgraf-dev/openapi-delphi-generator. The generated client is now not dependant on TMS BIZ anymore. Please follow the OpenAPI Delphi Generator repository for updates and upcoming features.
New: SQLiteConsoleServer demo updated with: middleware logging; validation attributes.
New: TXDataClient.RawSerialization property prevents the client from expecting "value" in server responses (a JSON object wrapping the response inside the "value" property).
Improved: For DTOs being sent in query params, attribute JsonInclude is not being taken into consideration, so properties with default values are not included in query string.
Improved: BREAKING CHANGE JWT is now requiring secret with a minimum size. If you use a secret that is smaller than the minimum size, you should set JWT Middleware property
SkipKeyValidation
to True.Improved: When JSON deserialization fails (for example, when a client sends wrong JSON in request), the error message now shows the detailed position of the error (complete path), making it easier for the client to know what part of the JSON was wrong. It also returns status code 400.
Improved: Entity validation now propagates the error message list to XData exception handler and to clients as JSON response.
Improved: TXDataWebClient.RawInvoke now provides a JavaScript Blob object in the Response.Result property, when the server method returns a TStream. (breaking change).
Improved: Schema generator is now generating named definitions (instead of inline schema) for object schemas inside arrays, dictionaries, Nullable
and Assignable types. Improved: RegularExpression validator now shows the regular expression in the error message so users know what is the regex they have to match.
Fixed: Abstract error when serializing TBlob (regression).
Fixed: Validation of DTOs containing JSON classes (TJSONValue, TJElement) was causing Access Validation.
Fixed: Android/iOS XData client not correctly handling JSON responses (regression).
Fixed: Eventual "Invalid Pointer Operation" (possibly causing database connections being locked in the pool) when calling POST/PUT in CRUD endpoints. The combination to raise the problem was rare, but could happen if the JSON sent by the client had errors and the entity structure had lists.
Version 5.6 (Jul-2022)
- New: $select filter option allows defining the fields to be present in JSON response. It not only saves bandwidth by reducing the JSON size, but also optimizes the server execution. For example:
http://server:2001/tms/xdata/Customer(3)?$select=Id,FirstName,Birthday
Results in
{
"Id": 3,
"FirstName": "Bill",
"Birthday": "1980-01-01"
}
New: OpenAPI importer allows you to import a 3rd-party server Swagger specification and generate a unit with high-level interfaces and DTOs for invoking the server endpoints.
New: JWT (JOSE) for Delphi units updated. You can now use RSA and ECDSA signing algorithms for both singing new JWT and also verify existing JWT signatures.
New: TXDataClient.InstanceLoopHandling, EntityLoopHandling, SerializeInstanceRef, SerializeInstanceType properties allows more control over the JSON properties sent from client to server.
New: TSwaggerUIOptions properties: TryItOutEnabled and CustomParams allows more customization of SwaggerUI.
Fixed: Swagger not working when service operations had PATCH methods.
Fixed: Reentrant XData calls causing AV when using InProc-server.
Fixed: Serialization of
TJSONNumber
fails when the value contained exponent character (e.g, 1E-5).Fixed: TMS XData Web Application wizard was generating code that wasn't compilable with latest versions of TMS Web Core.
Fixed: Ordered dictionary converter was not creating new instances, only modifying existing ones.
Fixed: Serialization
"Format 'Converter for %s is not object ' invalid or incompatible with argument"
error message.Fixed: OnModuleException not working correctly when action was RaiseException.
Fixed: string literals in URL failing if containing single quotes.
Fixed: Serialization of
TJSONObject
boolean properties were failing when the value type wasTJSONBool
, instead ofTJSONTrue
orTJSONFalse
.
Version 5.5 (Mar-2022)
New: Validation attributes now also work for DTO objects.
New: TXDataSwaggerUIOptions.DisplayOperationId property. Breaking change: this property
False
by default, which hides the operation id from Swagger UI.New: SwaggerExclude attribute now applies to DTO and entity properties.
Fixed: Serialization of polymorphic lists now correctly output the class name of the list item if different from the base class.
Version 5.4 (Feb-2022)
New:
TXDataConnectionPool.CleanupTimeout
property. When different than zero, the connection pool will release the connections that hasn't been used for the at least the time specified by theCleanupTimeout
property.New:
TXDataMultiDBConnectionPool
component allows for easy creation of XData modules connecting to multiple tenant databases.New: OnModuleException now includes a property named
Errors
in theArgs
parameter. This property, if filled, will add a list of errors in the JSON response to the client, in addition to the existing single error message.New: Client-side exception
EXDataClientRequestException
now also includes a propertyErrors
to provide a list of errors provided by the server (if available).New: TXDataHttpHandler.SetStatusCode allows setting a custom HTTP status code from XData service operations.
New: Now it's possible to close the HTTP response inside a XData service operation. In this case, XData will not touch the HTTP response anymore.
New:
Consumes
attribute allows receiving parameters asx-www-form-urlencoded
type.New:
JsonManaged
attribute allows flagging which associated objects in the DTO should not be automatically destroyed by XData serializer/deserializer.New: Swagger now supports and generates documentation from comments in DTO classes and properties.
New: You can specify which DTO properties will be flagged as "required" in Swagger, using the following XML comment:
/// <swagger name="required">true</swagger>
Improved: List and dictionary JSON serializers now automatically take
OwnsObjects
property into account, and do not try to destroy the items if such property is set to true.Improved: Better error message when database connection pool was not properly configured in XData server.
Improved: TXDataConnectionPool doesn't require the Connection property to be set, if a pool interface is provided via OnGetPoolInterface event.
Improved: JSON date-time deserialization now accepts dates in format
YYYYMMDD
and time in formathhnnss
.Improved: Swagger demo updated to show how to work with DTO documentation.
Fixed:
TXDataClient
was sending float parameters via URL query with wrong formatting depending on local settings (regression).Fixed: Music web demo was not compiling with latest Pas2JS/Web Core versions.
Fixed:
TJsonInclude.NonDefault
option was not working with nullable types.Breaking change: Internal method
SendErrorResponse
and interfaceIErrorWriter
were modified. If you use anyb of them, your existing code won't compile and you will have to adapt to the new signature.
Version 5.3 (Sep-2021)
New: Delphi 11 support.
New: Web Core application demo showing master-detail usage.
New: Web Core application demo showing blob/memo usage.
Fixed:
OnManagerCreate
event raising errors if Delphi memory manager is configured to completely clean memory upon destruction (FastMM in debug mode, for example).
Version 5.2 (Jun-2021)
New: XData Query Builder. You can now build XData queries using fluent interface using the new XData Query Builder, and then get the final query string to be used in your HTTP requests or queries using TXDataClient. For example:
Customers := Client.List<TCustomer>( CreateQuery .From(TCustomer) .Filter( (Linq['Name'] = 'Paul') or (Linq['Birthday'] < EncodeDate(1940, 8, 1)) ) .OrderBy('Name', False) .Take(10).Skip(50) .Expand('Country') .QueryString );
New: Mechanism to accept XData query options in service operations. You can now easily receive and process XData query syntax like
$filter
,$orderby
,$top
and$skip
in service operations, even for DTOs, and create Aurelius criteria from it:
type IMyService = interface(IInvokable)
[HttpGet] function List(Query: TXDataQuery): TList<TCustomer>;
{...}
function TMyService.List(Query: TXDataQuery): TList<TCustomer>;
begin
Result := TXDataOperationContext.Current
.CreateCriteria<TCustomer>(Query).List;
end;
New: Service operations can now receive DTOs (Delphi objects) from the query string of the request URL. You can now have service like this:
[HttpGet] function FindByIdOrName(Customer: TCustomerDTO): TList<TCustomer>;
And have your Customer
parameter be received from a request URL like this: /CustomerService/FindByIdOrName?Id=10&Name='Paul'
.
Improved: Nullable
types are now supported in plain Delphi objects (in addition to existing support in Aurelius entities). When using plain Delphi objects as DTOs, like when receiving or returning them in service operations, they are now properly serialized/deserialized as JSON.Improved: Internal
TJsonWriter
class is now 50% faster.Improved: Web Core stub for
TXDataClientResponse
was missing some properties.Fixed: Error "Could not convert variant array of type" when retrieving entities which Id is an association to another entity.
Fixed: XData enum values were ignoring
JsonEnumValues
attribute in Swagger Schema and$filter
queries.Fixed: Missing properties in XData entities created from Aurelius classes with
AbstractEntity
attribute.Fixed: Swagger support was being enabled automatically in Linux projects. This was causing an "AmbiguousActionError" exception when Swagger was also enabled in
TXDataServer
component.Fixed: SerializeInstanceType being ignored in entity property endpoints (e.g., Customer/City).
Fixed: "DevTools failed to load source map" error message now removed from web browser console log when executing TMS XData Music application.
Version 5.2.1
Fixed: Query Builder wrongly creating enumeration literals around quotes (
'tsMale'
).Fixed: Query Builder not finding properties from inherited classes when using
From
method passing class types.
Version 5.1 (Mar-2021)
Improved: All compilation warnings removed when using XData from TMS Web Core applications.
Fixed: Compilation error in Multitenancy demo.
Version 5.0 (Mar-2021)
- New: Attribute-based Authorization allows you to secure your REST API in a declarative way, adding attributes to methods and entities you want to be protected by specific permissions. It's as simple as adding authorization attributes to methods and entities:
[ServiceContract]
IMyService = interface(IInvokable)
[AuthorizeScopes('admin,writer')]
procedure ModifyEverything;
[Authorize]
function Restricted: string;
end;
[Entity, Automapping]
[EntityAuthorizeScopes('reader', EntitySetPermissionsRead)]
[EntityAuthorizeScopes('writer', EntitySetPermissionsWrite)]
TArtist = class
- New: async/await methods in XData web client makes it even easier to build TMS Web Core applications using XData as backend - the asynchronous requests to server can be coded as if they were synchronous:
var
Response: TXDataClientResponse
GreetResult: string;
begin
await(XDataConnection.OpenAsync);
Response := await(Client.RawInvokeAsync('IMyService.Greet', ['My name']);
GreetResult := string(TJSObject(Response.Result)['value']);
end;
New: RoutingPrecedence property in XData server allows you to override automatic CRUD endpoints behavior using service operations, by using the same routing URL.
New: Swagger demo projects now include a client-side application at
xdata\demos\Swagger\Client
that shows how Swagger can be helpful at client side.New: Demo
multitenancy
shows how to create multitenant servers using XData in an easy and straightforward way with the newTMultiTenantConnectionPool
implementation.New: OnManagerCreate event which is fired whenever a new TObjectManager instance is created by XData.
Fixed: Deserialization of a JSON empty object would result in nil object, instead of an empty (instantiated) object with default property values.
Fixed: List serialization failed when list to be serialized was nil in some situations.
Fixed: Batch operations not working in an optimized way when using connection interfaces coming from XData connection pool.
Fixed:
TXDataWebDataset
was not bringing ancestor persistent fields at design-time for entity classes in a inheritance hierarchy.Fixed: XML documentation tags for SwaggerUI were being ignored for service contracts with an empty route (the "default" endpoint).
Fixed: SwaggerUI was sometimes displaying empty tags. This happened with Automatic CRUD Endpoints, when no endpoint were set for an existing entity. Still, the tag for the entity appeared.
Fixed: Error "Cannot deserialize value from Url format" when invoking service operations passing double values in URL - for example:
?a=1.6
).Fixed: Typo in
EInvalidParamBinding
exception message: "Invalid binding in param".
Version 4.17 (Sep-2020)
New: Full support to use XML documentation in Swagger documents. You can now describe your REST API documentation using XML documentation syntax, and even using the same content for both. Write your documentation once, use it in several places - for your Delphi developer, for your API consumer.
New: SwaggerExclude attribute allows you to exclude specific endpoints from the final Swagger API documentation.
New: Swagger demo shows how to create Swagger documentation, provide SwaggerUI interface to your end user, and use XML documentation to enrich your documentation content.
Improved: Service contract routing now allows replacing the root URL. Requests like "GET /" or "POST /" can be now be configured to be routed to your own service implementation.
Improved: Swagger documents now take entity set permissions into account, omitting Aurelius CRUD endpoints which are not available due to the entity set permissions configuration.
Improved: The endpoints for Swagger-UI ("/swaggerui") and Swagger.json ("/openapi/swagger.json") don't appear anymore in the Swagger document itself. This avoids pollution of the Swagger document, focusing only on your own API endpoints.
Improved: Endpoints are now sorted alphabetically in Swagger documents, making it much easier to be visualized in Swagger-UI for example.
Improved: Parameters and function results of type TDate, in service contracts, will now show in Swagger document as "date" instead of "date-time".
Version 4.16 (Aug-2020)
New: FireDAC-SQL demo shows how to create a REST resource (GET, POST, PUT, DELETE) using FireDAC to access the database directly via SQL, without using TMS Aurelius.
Improved: EXDataClientException now contains property Info holding the JSON response of the error.
Improved: XData Web Request (THttpRequest) now provides Timeout property.
Improved: Compatibility with TMS Web Core 1.5.
Fixed: Service operations returning objects and also with "out" params were returning wrong JSON.
Fixed: When loading objects using TXDataClient, proxied objects were not being loaded if they were located at a depth level higher than the MaxEagerDepth configuration (default to 3).
Fixed: SwaggerUI was not working in SQLiteConsoleServer demo.
Version 4.15 (Jun-2020)
Improved: XData trial binary compatibility with TMS Web Core 1.4.2 trial.
Fixed: Wrong serialization of objects that indirectly inherited from List<T>. For example, TList2 = class(TList1), TList1 = class(TList<TSomeClass>). Serialization of TList2 was wrong.
Version 4.14 (Jun-2020)
- Improved: Web Core client components updated to support the newest TMS Web Core 1.4.
Version 4.13 (May-2020)
New: Flexible URL routing mechanism using Route attribute, allows multiple segments in path routing, and flexible parameter binding. For a single method, users can route it to an URL like 'orders/approved/{year}/{month}'. The service operation will be routed from the invoked URL, and the values passed in URL will be automatically bound to method parameters.
New: Delphi 10.4 Sydney support. Full compatibility with the recently released new Delphi version.
New: XData server now returns a xdata-version header in each request. This will make it easier to tell the available features of the XData server being connected to. Current version returned is 2.
New: TXDataClient.ForceBlobLoading property for backward compatibility with old XData servers that could not receive eager blobs as @xdata.proxy.
Improved: Significant performance increase when sending entities to XData server that contain blobs. For example, consider a Customer with Photo (blob) field you retrieved using TXDataClient. In previous versions, calling Put to update the customer would load the Photo content from the server, even if it was not modified. Now it's optimized and it will send to the server just a proxy information. The server is also now smart enough to identify those proxies and proceed properly, even when the blob is not lazy.
Improved: Blob serialization was not flagging blob as loaded, causing a lazy blob to be loaded multiple times. Suppose there is a property TCustomer.Photo of type TBlob. Such blob is lazy and not loaded. During JSON serialization, the content of the blob is loaded, but property TCustomer.Photo was not being marked as load. Thus, in a second serialization, or when the app tried to read property content, the blob would load again.
Improved: It's now possible to send blobs in JSON using format "Photo@xdata.proxy": "Customers(1)/Photo", even for blobs not flagged as lazy. In previous versions, this was only possible for lazy blobs. Sending such values will simply not modify the blob value in the server.
Improved: Ambiguity between enumeration and member name solved in $filter expressions. Suppose a filter expression like "$filter=Pending eq 2". There might be a situation where Pending would be both an enumeration name and an entity property. Now, if that happens, Pending will be considered as an entity property. Otherwise, as an enumeration.
Improved: Enumeration values can be prefixed by the enum type in $filter expressions. To avoid ambiguous naming, enumeration values in filter expressions can now be prefixed by the enum type. For example: "$filter=Pending eq TStatus.Pending". TStatus.Pending is an enumeration value, Pending is a property value.
Fixed: Memory leak when building a TXDataAureliusModel object using a TXDataModelBuilder raises an error.
Fixed: TXDataClient 404 error not raising exception when server methods did not return objects (procedures, not functions).
Fixed: Value endpoints (/$value) were not returning correct string values when the content had double quotes.
Fixed: Serialization of TArray<byte> and TBytes was not working correctly when the application/server was compiled using runtime packages.
Fixed: Error "Requested action has ambiguous implementation" in SwaggeUI endpoint when starting/stopping XData server multiple times.
Fixed: Delphi IDE splash screen showing multiple XData icons.
Fixed: XData Web App Generator creating wrong persistent fields when XData server had GUID field types.
Version 4.12 (Apr-2020)
Improved: UriPathSegment now can be applied to entities (for entity set naming).
Fixed: TXDataWebClient not raising OnError events when an error happened during RawInvoke call.
Fixed: XData Web Application generator updated to work with latest Web Core 1.4.
Fixed: XData Music Demo updated to work with latest Web Core 1.4.
Version 4.11 (Apr-2020)
New: Enumerated literals now supported in $filter query string.
Fixed: Wrong TXDataWebDataset date/time conversion from JSON (regression). It was causing "Invalid date time" errors and also was displaying wrong date time fields, by incorrectly adding time zone offset to the date.
Fixed: TXDataClient.IgnoreUnknownProperties had no effect when using service operations.
Version 4.10 (Mar-2020)
New: OnEntityDeleted, OnEntityInserted, OnEntityModified are new server-side events that fire after automatic CRUD endpoint operations are performed, in addition to existing OnEntityDeleting, OnEntityModifying and OnEntityInserting events, which are performed before such operations.
New: JsonConverter attribute allows for custom JSON serialization/deserialization of specific PODO and entity properties. You can for example serialize an integer as an string, a date/time as a string in a specific format, etc.
New: Support for TStream param mixed with other params. You can now have a service operation that receives a TStream parameter to also receive more parameters, as long as they are not defined to be in the request body (using FromBody parameter). This way you can use the TStream to process the raw body of the request, but still receive other parameters through the URL (either using FromQuery or FromPath attributes).
New: Demo project showing how to use multiple models (multi-model design) in XData.
New: BasicAuth demo showing how to use Basic Authentication in both server and client sides.
New: Demo project showing how to use XData as an Apache module.
Improved: Swagger doesn't include definition names for lists anymore (interface gets less cluttered).
Fixed: Swagger specification was wrong for entity sets (in automatic CRUD endpoint). It was indicating an array of entities, but the correct format was an object with "value" property and then array of entities, according to the specification.
Fixed: Sending an object with a blob property set to null was not modifying the blob in the database.
Fixed: Generated XData Web Application was being created with title "TMS XData Music Web Application". The word "Music" was removed from the title.
Version 4.9 (Nov-2019)
New: Support for Android 64-bit platform (Delphi 10.3.3 Rio).
New: TXDataOperationContext.CreateManager and AddManager methods. You can now add more Aurelius managers (TObjectManager) to the XData context. This makes it easier to create other Aurelius managers in addition to the default one, and at the same time return entities from that new manager, without worrying about evicting those objects to destroy them.
New: TXDataClient.IgnoreUnknownPropeties property. You can now set this property to true to force the client to ignore properties sent by the server that the client don't know. Until now, the client would raise an exception saying the property is unknown.
Improved: $expand now appears as an optional parameter in SwaggerUI for endpoints that return Aurelius entities.
Improved: SwaggerUI was displaying parameters as required even when they had default values in service operations.
Improved: TXDataWebDataset compatibility with TMS Web Core 1.3. There is a breaking change between TMS Web Core 1.3 and 1.2 regarding dataset, which means this XData version won't work with previous TMS Web Core versions (1.2 and lower).
Fixed: TXDataClient and TXDataWebClient were building request URLs with double slashes (//) in some requests. This didn't cause any errors but was wrong anyway.
Fixed: TMS XData Music Demo failed to compile in TMS Web Core 1.3 (fixed in 4.9.1).
Fixed: TMS XData Web Application wizard was generating code that didn't compile (fixed in 4.9.1).
Version 4.8 (Oct-2019)
Improved: TXDataWebClient was raising some exceptions as Exception class. It's now using EXDataClientException.
Fixed: SQLiteConsoleServer demo (the "Music server" used in several demos, like the TMS XData/Web Core Music Web Application) was not correctly importing Tracks into Albums.
Version 4.7 (Sep-2019)
New: $expand query option now also applies for blobs. In previous versions, clients could request associations to be inline in JSON response by using the $expand query option in format "$expand=Customer". Now you can also ask for blob properties to be inline (as base64 string) in the JSON response, by providing the name(s) of blob properties in the $expand query option. For example, "$expand=Photo".
Improved: TXDataWebClient.Post now updates the key (id) properties of the object with the generated value returned by the server. When calling TXDataWebClient.Post you pass a Javascript object instance to the method, which will be serialized as JSON and sent to the server to be inserted. If the server generates a new id for the object, then the Javascript object instance passed to Post will have its id property automatically updated with the id generated by the server. This has a good side effect on using TXDataWebDataset as well: when automatically applying updates using TXDataWebDataset, the id fields will automatically be filled with the server-side generated value.
Improved: Polymorphism when deserializing JSON objects allows deserializing both PODO and XData/Aurelius entities using the same method. For example, suppose a service operation (server-side method) that receives a parameter of type "TObject". Clients can now send either a PODO object or a Aurelius entity object to that method, and either will be serialized correctly. In previous versions it would consider everything as PODO and wrongly serialize the Aurelius entity.
Fixed: Multiple calls to TXDataWebDataset.ApplyUpdates could cause some errors. That would happen if in the second call to ApplyUpdates, the modifications of the first call were not yet sent to the server, causing the same delta to be processed twice.
Version 4.6 (Jul-2019)
New: HttpPatch attribute to specify service operations responding to PATCH HTTP method.
New: macOS 64 support in Delphi Rio 10.3.2.
Fixed: Swagger not including all service operation actions when the actions endpoints were the same.
Version 4.5 (Jun-2019)
New: FromQuery, FromPath and FromBody attributes allow higher control in parameter binding and URL routing for service operations.
New: Support for SwaggerUI provides a built-in web-based environment to test the API from the browser.
New: SwaggerOptions and SwaggerUIOptions properties allow to easily enable and configure Swagger support for the API.
New: EnableEntityKeyAsSegment property allows single-entity URL endpoints to follow the format "entity/id" - for example, customer/10, in addition to existing default format customer(10).
Improved: String and enumeration literals now can be sent in URL without being enclosed by single quotes (e.g., CustomerByName?Name=John instead of CustomerByName?Name='John').
Fixed: TXDataWebClient invoking service operations with default parameters was requiring all parameters to be passed, including the ones with default values.
Version 4.4 (Mar-2019)
Fixed: Index out of range error in TMS XData Web Application Wizard when XData server has no entities.
Fixed: Generated XData Web Application not supporting filtering by subproperties (e.g., Invoice/Customer/Name eq 'John').
Version 4.3 (Jan-2019)
New: XData Server wizards generate XData server applications using the new design-time components instead of pure code. The generated application is now way easier to maintain and evolve, given it uses the RAD approach with design-time components. There is now wizard for server as VCL application. Next versions will include console application, Apache module or Windows service.
New: TXDataWebDataset.EnumAsInteger property controls how enumerated type properties will be represented in the dataset. This is a breaking change.
Improved: All demos refactored, now using the new non-visual components: TXDataServer, TAureliusConnection, TXDataConnectionPool and TSparkleHttpSysDispatcher, making them easier to understand for beginners and easier to change them.
Improved: TXDataWebClient.OnLoad method now provides the newly created entity in the Args.Result property, when using Post method.
Fixed: TXDataWebClient.OnRequest event not being called when executing service operations with RawInvoke method.
Fixed: Workaround a bug in Delphi Rio causing serialization of TJSONNumber values to be always serialized as null (TJSONNumber.Null always returning true).
Fixed: Type mismatch when passing an empty array to a service operation that receives the dynamic array as var/out parameter.
Fixed: XData Service wizard did not appear if there was no open project in IDE.
Fixed: Inoffensive memory leak in TSparkleHttpSysDispatcher when the dispatcher was never activated.
Fixed: TXDataWebDataset now creates TFloatField field for XData properties of type Currency, instead of TCurrencyField (unsupported in TMS Web Core clients).
Fixed: XData Music Demo was issuing JSON Web Tokens with wrong expiration date/time.
Version 4.2 (Dec-2018)
Improved: TXDataWebConnection now "disconnects" (cleans model object, requiring a new connection) when URL is modified.
Fixed: Workaround for a bug in Delphi Rio causing JWT tokens to be always rejected due to expiration (TJSONNumber.Null always returns true).
Fixed: TXDataWebClient.RawInvoke did not allow to receive a full JSON object as a single parameter.
Fixed: XData Web App Application Wizard incorrectly created TExtendedField fields for Int64 types on the server.
Fixed: Typo in the generated XData service code: "form the client" should be "from the client".
Version 4.1 (Nov-2018)
New: XData Web Application Wizard to generate GUI to perform CRUD operations on entities. You can now generate a web application that allows users to insert, modify and/or delete entities.
New: Support for Delphi 10.3 Rio.
Fixed: TTime fields not correctly supported in TXDataWebDataset.
Fixed: XData Service Wizard created new service units in the first project of a project group. New services will be created in the currently active project now.
Version 4.0 (Nov-2018)
New: XData Web App Generator wizard. This wizard creates a complete TMS Web Core client app based on a responsive Bootstrap template. The generated application should be based on an XData server and will provide a user-interface for listing XData server entities, including searching, ordering and pagination.
New: Design-time support with a new set of components for XData: TXDataServer and TXDataConnectionPool components.
New: XData Service Operation wizard. Makes it very easy to create new service operations (server-side business logic).
Improved: TXDataWebDataset.Load now automatically connects the TXDataWebConnection if it is not connected.
Improved: TXDataServerModule.SetEntitySetPermissions supports '*' as the entity set name which will be considered the default permissions for all entity sets.
Improved: TXDataClientResponse.ResultAsArray and ResultAsObject for quick access to Result as a Json array or object.
Fixed: TXDataWebClient.RawInvoke did incorrectly require parameters of type "out".
Fixed: TXDataWebDataset did not set correct datetime values for the entity properties.
Version 3.2 (Sep-2018)
New: TXDataWebDataset properties QueryTop, QuerySkip, ServerRecordCount, ServerRecordCountMode. This makes it easier to retrieve paged results from the server (QueryTop, QuerySkip) and retrieve the total number of records on the server (ServerRecordCount, ServerRecordCountMode). This number does not take the page number and page size into account.
New: TJwtMiddleware.AllowExpiredToken and ForbidAnonymousAccess properties. This makes it easier to reject requests with expired tokens or requests without tokens (anonymous). Just set these properties. This is a breaking change as the middleware now rejects expired tokens by default. Please refer to the TMS Sparkle documentation for more information.
New: TCorsMiddleware middleware makes it straightforward to add CORS support to any Sparkle module. Please refer to the TMS Sparkle documentation for more info.
Improved: XData Music Demo includes options for ordering, paging and filtering (search) of listed records.
Improved: "New TMS XData Server" Wizard adds commented code to include CORS and Compress middleware. Uncomment the generated code to easily enable the features.
Improved: URIPathSegment attribute with empty string can be inside a service contract; it supports creating service operations at the "root" of the server.
Fixed: TXDataWebDataset now correctly creates TStringField for GUID properties (TGuidField is not supported in TMS Web Core).
Fixed: Removed memory leaks in desktop client of the JWT Auth demo.
Fixed: "New TMS XData Server" wizard updated with option to use new TMS Aurelius native database drivers.
Version 3.1 (Jul-2018)
New: XData Music Web Application demo. A complete web application example using a TMS XData server with TMS Web Core as web front-end. Full source code is provided, and the online version of the demo is available at https://app.devgems.com/xdata/music/app.
New: TXDataWebClient.ReferenceSolvingMode allows automatic solving of $ref occurrences in JSON response, which is now the default behavior.
New: Demos XData Web-Client Framework, showing use of TXDataWebClient, TXDataWebDataset and integration with FNC Grid.
New: TXDataWebConnection.OnResponse event intercepts all successful HTTP requests made by the XData web client framework (3.1.1).
Fixed: Servers with Int64 type in model were not supported when used from TMS Web client (3.1.1).
Version 3.0 (Jul-2018)
New: Full-featured TMS XData Web-Client Framework provides RAD, design-time and high-level components for building web applications using TMS Web Core and TMS XData. Buildling a REST API-based web application has never been as easy. This includes dataset-like usage that feels home to Delphi developers.
New: TXDataWebClient.RawInvoke allows low-level invoking of service operations from TMS Web Core applications.
New: TXDataWebConnection.OnRequest and TXDataWebClient.OnRequest events allow intercepting and modifying outgoing requests (for example, to add authentication headers).
New: TXDataWebDataset.CurrentData provides the underlying JSON object of the current web dataset record.
New: TXDataWebConnection.OnError event which is fired whenever an error happens while performing requests to XData server from TMS Web Core apps.
New: TXDataWebClient request methods (List, Get, Post, RawInvoke, etc.) now have overloaded methods that accept callback functions.
New: TXDataWebConnection.Open method allows for providing callbacks for connection successful and connection error.
New: TXDataWebConnection.DesignData allows for adding custom headers at design-time (for example authorization) to properly connect to XData server.
Improved: Smooth design-time experience with TXDataWebDataset. Manually loading field defs is not necessary anymore - just connect a dataset to a web connection, provide the URL and fields will be loaded automatically at both design-time or runtime. Design-time menu option "Load Field Defs" has been removed.
Improved: Editing TXDataWebDataset.EntitySetName at design-time in object inspector now provides a combobox with the list of available names retrieved from the server.
Improved: Dataset fields now supported in TXDataWebDataset. They will contain data (list of objects) for associated lists (many-valued associations).
Improved: TXDataWebDataset.SetJsonData now accepts non-array values (to edit a single object, for example).
Improved: TXDataWebClient.Get overloaded method allows for passing an additional query string (to use $expand option for example).
Improved: TXDataServerModule.Create overload requires just BaseUrl - no database connection pool is needed. Useful for XData servers that do not connect to a database or have a specific database usage.
Improved: TMS Web Core-only TXDataConnection and TXDataDataset components have been renamed to TXDataWebConnection and TXDataWebDataset. This is a breaking change.
Fixed: Exceptions that were not inherited from EXDataHttpException were wrongly reporting an error code (regression).
Fixed: Memory leaks when using mobile/Linux compilers (when using automatic reference counting).
Version 2.9 (May-2018)
New: OnModuleException event allows for a more flexible custom error-handling processing of exception raised during XData processing request.
Fixed: OnEntityModifying event was being fired before merge operation thus not providing correct information about the object in manager and previous state. Breaking change that can be disabled by using _FixEntityModifyingOnUpsert := False.
Fixed: Deserialization of array of objects was keeping the same instance for all objects in the array.
Version 2.8 (Feb-2018)
New: TMS RADical WEB enabled! The TMS framework for front-end Web development; XData users now have a high-level framework to write Web clients, by using the new TXDataConnection, TXDataDataset and TXDataWebClient components to access XData servers.
New: TXDataClient.Count method. Allows retrieving the number of entities in a specific resource endpoint, optionally using a query filter:
TotalCustomersFromLondon := XDataClient.Count('$filter=City eq ''London''');
- New: TQueryParser.AddMethod allows registering custom SQL Functions to be called from XData query API. Using TMS Aurelius you can add custom SQL functions to use from LINQ. You can now also register such a method in XData so clients can use such functions from the XData API:
TQueryParser.AddMethod('unaccent', TQueryMethod.Create('unaccent', 1));
Then use it from query API:
http://server:2001/tms/xdata/Customer?$filter=unaccent(Name) eq 'Andre'
New: /$model built-in URL returns metadata for the whole XData API.
New: MultiTentant Demo included in distribution shows how to use XData with multi-tentant applications (multiple databases being accessed by the same server). The demo shows how to specify the tentant by different URL or by using a custom HTTP header.
Improved: A connection was being retrieved from the pool even when the context manager was not being used by a service operation.
Fixed: Service operations invoked via GET method using enumerated type parameters are now supported.
Version 2.7 (Oct-2017)
New: OpenAPI/Swagger support! XData servers provide a JSON file containing the OpenAPI Specification (OAS, formerly Swagger) for your whole server API. This opens up a lot of possibilities, usage of several tools of the OpenAPI ecosystem is now possible. Main one is the Swagger UI, a web front-end to describe and test your API.
New: Several new types supported in service operations. Lots of new Delphi types can now be (de)serialized to JSON, meaning that these types can be used in service operations, either as input parameters, or as function results, or even as properties of PODO objects sent/received. The new supported types include:
Generic arrays: values of type TArray<T>, where T can be any supported type;
Generics lists of primitive types: values of type TList<T>, where T can by any supported type. In previous versions only lists of objects were supported;
Sets: values of type "set of T" where T is an enumerated type;
TStrings type.
New: Support for default parameter values in service operations. You can now specify default values as parameters in service operations, using the [XDefault] attribute, and make them not required when invoking the service operations from non-Delphi clients (default parameters were already supported in Delphi clients).
New: JsonInclude attribute in PODO classes. You can configure how properties/fields with default values will be serialized in PODO classes. This attribute makes it possible to have a smaller JSON representation, by removing properties which value is null, zero, empty string, etc. Usage example: [JsonInclude(TInclusionMode.NonDefault)].
New: JsonNamingStrategy attribute. Allows you to automatically define a strategy for naming the JSON properties based on the field/property names of the class. You can use several predefined strategies: default, identity, camelCase, snake_case, identityCamelCase, identity_snake_case.
New: JsonEnumValues attribute. You can use this attribute to specify different values when serializing enumerated values.
New: TXDataRequestHandler.ManagedObjects property. This property provides more flexibility when it comes to automatic memory management at server side, allowing you to add objects to that collection and don't worrying about destroyed them.
Fixed: Error when using params of type TDate (TDateTime was not affected) in service operations (Regression).
Fixed: Design-time wizard icon not showing correctly in Delphi 10.2 Tokyo.
Version 2.6 (Jul-2017)
New: XDataProperty and XDataExcludeProperty attributes. When converting Aurelius entities to/form JSON, by default XData serializes all (and only) fields/properties that are mapped using Aurelius attributes. You can now include other (transient) properties or fields in JSON by using XDataProperty attribute. You also have the option to exclude an existing mapped member by using XDataExcludeProperty attribute.
New: JsonProperty and JsonIgnore attributes. When serializing regular Delphi objects (DTO) to JSON, XData includes all class fields by default. You can use JsonProperty attribute to add properties to the JSON (and/or change their name in JSON object) and use JsonIgnore attribute to exclude fields from JSON.
New: Support for passing parameters by reference in service operations. You can now declare and use service operations (methods) that receive parameters by reference. A server method like Swap(var A, B: Integer) is now supported for both server-side and client-side (using TXDataClient or regular HTTP requests).
New: Filter functions startswith, endswith and contains. You can now perform $filter queries with those functions to search for substrings in entity fields. For example: ?$filter=contains(Name, 'Walker') or startswith(Name, 'John').
New: Filter function concat. You can now use concat function when performing queries to concatenate two or more strings. For example: ?$filter=concat(concat(FirstName, ' '), LastName) = 'James Smith'.
New: TXDataSeverModule.UnknownMemberHandling property. You can now optionally tell the server to ignore unknown JSON properties sent by the client (instead of raising an InvalidJsonProperty error).
Fixed: Using TStream as a parameter for service operations was causing "JSON converter not found" error.
Version 2.5 (May-2017)
New: Linux support using Delphi 10.2 Tokyo and later. Using XData on Linux doesn't require any specific change in your XData-related code. All your Linux specific code relates to TMS Sparkle - creating an Apache module and configuring TMS Sparkle to respond to requests. Once you do that, you just add the XData module to the Sparkle dispatcher as usual.
Fixed: Location header of POST responses now uses host of the client request, not the host configured in XData module.
Previous Versions
Version 2.4 (Mar-2017)
New: Delphi 10.2 Tokyo Support.
Fixed: Server-side stack overflow when trying to load a proxy property sent by the client, if the parent entity of that proxy was merged into the current Object Manager.
Version 2.3 (Jan-2017)
New: Demo project showing authentication using JWT (JSON Web Token).
Fixed: Sporadic server error loading proxied lists sent by the client.
Fixed: JWT encoding not working on XE6.
Fixed: XData Server Wizard generating corrupted source code when TMS Component Pack was installed.
Version 2.2 (Aug-2016)
New: Url convention now allows $count path segment to retrieve number of entities in a resource.
Fixed: RefCount property was wrongly being serialized in PODO objects from mobile clients.
Fixed: TXDataClient.Service<T> failing for Android clients when compiling in Release config.
Version 2.1 (Jul-2016)
New: $expand query option allows clients to have full control on how associated entities appear in JSON response.
New: Support for entities that have associations in ID (primary key containing foreign keys).
New: Support for Variant-type parameters in service operations when using GET HTTP method.
New: Breaking change: TXDataServerModule.PutMode property controls how PUT will behave at server-side.
New: TXDataServerModule.SerializeInstanceRef property controls how instances of same object will be represented in JSON response.
New: TXDataServerModule.SerializeInstanceType property controls how xdata type metadata will appear in JSON response.
New: Support for Nullable<T> values in PODO classes.
Improved: Errors on query syntax now return http code 400 instead of 500.
Fixed: JSON Proxies (@xdata.proxy) sent by the client were not being solved when reading such properties at server-side.
Fixed: Association references (@xdata.ref) were not being solved when receiving entities in service operations parameters.
Version 2.0 (May-2016)
New: Service operations can now receive and return any type of object. This increases flexibility significantly as you can use any type of object for structure input/output parameters, or to send/receive DTO classes, etc.
New: Server-Side Events allow subscribing listeners events and perform additional server-side logic
New: JWT (Json Web Token) authentication and Basic authentication, thanks to new TMS Sparkle.
New: Authentication and authorization mechanism, based on TMS Sparkle.
New: Delphi 10.1 Berlin support.
New: Service operations can now receive and return TJSONAncestor objects (Delphi XE6 and up only). This allows full control over the JSON request and response.
New: Service operations can now receive and return TCriteriaResult objects, making it easy to return Aurelius query results that use projections.
New: $inlinecount query option allow retrieving the total number of entities when using paged results.
New: Method TXDataModelBuilder.RemoveEntitySet for more flexibility when building XData models.
New: TXDataServerModule.SetEntitySetPermissions allows configuring what operations are available in each resource type.
Improved: All server-side operation (entity CRUD, service operation execution) are now performed in database transactions.
Improved: TXDataOperationContext.Current now also available in entity resources.
Version 1.6 (Feb-2016)
New: Design-time wizard to create a XData Server with a few clicks.
Fixed: Service operation using enumerated types as parameters or function results not working properly.
Fixed: EntitySet requests were not taking xdata-expandlevel header into consideration. This is a breaking change.
Version 1.5.1 (Sep-2015)
- New: Delphi 10 Seattle support.
Version 1.5 (Aug-2015)
New: Several built-in functions available to increase flexibility when querying objects in REST requests. New available functions are Upper, Lower, Length, Substring, Position, Year, Month, Day, Hour, Minute and Second.
New: TXDataClient.HttpClient property provides low level access to the Http client and allows using OnSendingRequest events to customize requests.
New: TXDataOperationContext Request and Response properties gives full control for service implementations to customize the processing of client requests.
New: TXDataServerModule.DefaultExpandLevel allows defining the expand level of JSON responses when it's not defined by client request.
Fixed: TXDataClient Get, Delete, Patch and Put operations were broken when using entities with composite id.
Fixed: POST requests not working correctly with entities with composite key.
Fixed: Data Modification requests sending content-type header with parameter (for example, ";charset=UTF8") were causing errors.
Version 1.4 (Jun-2015)
New: HttpMethod attribute allows specifying the HTTP method a service operation should respond to.
New: URIPathSegment attribute allows specifying a different name for operation/service to be used in URL.
Fixed: GET requests with query order was sometimes causing the same column to appear multiple times in a "ORDER BY" SQL clause.
Version 1.3.1 (Apr-2015)
- New: Delphi XE8 support.
Version 1.3 (Mar-2015)
- New: Support for CORS (Cross-origin resource sharing) preflighted requests.
Version 1.2 (Dec-2014)
New: TXDataClient methods Get, Post, Put, Delete and List allows easy and high-level access to XData server objects from Delphi clients.
New: Android and iOS support for XData client objects.
New: Server support for "x-http-method-override" header (allowing clients to tunnel HTTP methods to server through POST requests).
Fixed: Issues with floating-point literals in Query URL with non-English server systems.
Fixed: Service operations returning nil entities should respond with status code 404.
Version 1.1 (Oct-2014)
New: Service Operations allow adding custom business logic to your server using interfaces and methods.
New: Multi-Model design makes it easy to create multiple servers with different mapping, types and service operations.
New: UserName and Password properties in TXDataServerModule for basic authentication protection.
Version 1.0.1 (Sep-2014)
- New: Delphi XE7 support.
Version 1.0 (Aug-2014)
- First public release.