larshp / ABAP-Swagger

Expose ABAP REST services with Swagger/openapi spec
MIT License
97 stars 40 forks source link

Change content from `text/plain` to `text/html` if swagger service is a sub-element in SICF #82

Open bilencekic opened 2 years ago

bilencekic commented 2 years ago

If Swagger service is created as a subelement of a REST service, content type by default comes as text/plain and Swagger.html source codes are printed on browser. UI won't be displayed.

Parent service request handler needs to be skipped to trigger Swagger service( since it is a child element ) as below.

me->if_http_extension~lifetime_rc = if_http_extension~co_lifetime_destroy. me->if_http_extension~flow_rc = if_http_extension~co_flow_ok_others_mand

Above codes will skip REST handler to be destroyed and child handlers to be triggered. Once Swagger handler is triggered, output can be seen as text/plain for content type. This PR will fix it.