delphimvcframework icon indicating copy to clipboard operation
delphimvcframework copied to clipboard

Swagger describing SSE endpoint

Open radexpol opened this issue 2 years ago • 2 comments
trafficstars

How to describe controller using SWAG* Attributes (and MVCDoc?) to get the well formatted name of SSE Endpoint?

type
  [MVCPath('/v1/events')]
  [MVCSWAGDefaultSummaryTags('Events')]   -> this does not show well-formatted name of endpoint in swagger
  TEventsController = class(TMVCSSEController)
  protected
    function GetServerSentEvents(const LastEventID: String): TMVCSSEMessages; override;
  end;

radexpol avatar Jan 30 '23 08:01 radexpol

You can describe your SSE controller using the MVCSwagSummary attribute. The Description parameter of the MVCSwagSummary accepts a string in markdown format.

joaoduarte19 avatar Feb 06 '23 11:02 joaoduarte19

Does not work, does it work for you?

  TEventsController = class(TMVCSSEController)
  protected
    [MVCSwagSummary(TSwaggerConst.USE_DEFAULT_SUMMARY_TAGS, 'Endpoint description', 'GetServerSentEvents')]
    function GetServerSentEvents(const LastEventID: String): TMVCSSEMessages; override;
  end;

radexpol avatar Feb 06 '23 12:02 radexpol