Blog
All Blog Posts | Next Post | Previous Post
TMS XData 4.5: Parameter Binding and SwaggerUI
Wednesday, June 19, 2019
TMS XData 4.5 has been released with two major new features: parameter binding and Swagger UI.SwaggerUI is a great new addition, just by setting two simple properties in TXDataServer component (you can do it from the object inspector at design-time):
XDataServer1.SwaggerOptions.Enabled := True; XDataServer1.SwaggerUIOptions.Enabled := True;

Parameter Binding
Flexible parameter binding via attributes is another nice addition that provides you more control on how the API method must be invoked via raw HTTP requests - note that if you use Delphi XData Client or TMS Web Core XData Web Client, this is transparent to you, you just specify the method and parameter, and binding and routing is automatic.
But if you intend to call your API from non-Delphi platforms, you can now fully control how it works. You can declare methods like this:
procedure Process( [FromPath] PathA: Integer; [FromQuery] QueryA: string; BodyA, BodyB: string; [FromQuery] QueryB: Boolean; [FromPath] PathB: string; ): double;
POST /tms/xdata/MyService/Process/5/value?QueryA=queryvalue&QueryB=true HTTP/1.1 { "BodyA": "one", "BodyB": "two" }
If you want to see both parameter binding and SwaggerUI in action, take a look at this new video about it:
Wagner Landgraf

This blog post has received 9 comments.

Price Rhett

Bosnjak Boris

Juhász Zsolt

Farias Anderson

Wagner R. Landgraf

Jason Chapman


Wagner R. Landgraf

/v1/companies/:company/users/:username/signatures
How we can implement that with use of [FromPath] ?
Dmitry
All Blog Posts | Next Post | Previous Post
Piffer Claudio