Search code examples
apirestdelphidocumentation-generationdatasnap

Generating documentation for a Datasnap RESTful API


I've been looking for a way to include an auto-generated documentation endpoint to an existing Delphi Datasnap RESTful API.

Can it be done? Are there annotations or external tools I can use? Where would I begin, how would I proceed? If not from within Delphi itself, can I integrate with e.g. Swagger?

It seems somewhat anachronistic to build a RESTful API without offering a documentation endpoint these days...

Any and all information that could help me in the right direction would be greatly appreciated.


Solution

  • Using Swagger, via YAML has just been added to Delphi through EMS, the latest RESTful API development option in Delphi.

    https://delphiaball.co.uk/2016/04/22/swagger-yaml-delphi/

    Its based on Attributes that are added to the API end points as they are defined and that in turn creates the YAML to import into Swagger.