Blog
All Blog Posts | Next Post | Previous PostTMS 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.
2. Wednesday, June 19, 2019 at 11:40:11 PM
Woo hoo!!!
Price Rhett
3. Thursday, June 20, 2019 at 2:16:55 PM
So awesome!
Bosnjak Boris
4. Thursday, June 20, 2019 at 7:24:36 PM
Good new functions!
Juhász Zsolt
5. Friday, June 21, 2019 at 2:49:14 PM
Parameter Binding is a GREAT addition ! Congrats and Thanks!
Farias Anderson
6. Friday, June 21, 2019 at 3:18:11 PM
Thank you all for the great comments, I''m happy for all the positive feedback on this release!
Wagner R. Landgraf
7. Tuesday, February 11, 2020 at 1:36:31 PM
Just started using swagger in my testing - what a great feature!
Jason Chapman
8. Tuesday, February 11, 2020 at 1:42:35 PM
Thanks, Jason!
Wagner R. Landgraf
9. Thursday, April 9, 2020 at 9:06:27 PM
Hi Wagner, in specification by client we have such path:
/v1/companies/:company/users/:username/signatures
How we can implement that with use of [FromPath] ?
/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