The OpenAPI introspection resource returns an incorrect specification #6511
Labels
Area/CompilerPlugin
module/http
module/openapi-tools
Reason/MultipleComponentInteraction
Issue occured due to interactions in multiple components.
Type/Bug
Milestone
Description:
We can add an introspection resource to an HTTP service by adding the following OpenAPI annotation:
When the OpenAPI contract path is not specified in the above annotation, OpenAPI compiler plugin checks that and we generate the OpenAPI specification by passing the service declaration node to the OpenAPI tool. The generate specification is added to the
http:ServiceConfig
annotation via a code modifier in the OpenAPI tool. Then the HTTP compiler plugin reads that field and generate a introspection resource and inject that to the existing service.But the issue arises with the HTTP code modifier which actually adds the
@http:Payload
annotation to the request payload. Since this code modifier is engaged after the OpenAPI compiler plugin, the OpenAPI tool tries to generate the specification without this specific annotation which ends up in a incorrect specification.Steps to reproduce:
Run the following service:
Use the introspection resource to retrieve the specification:
$ curl http://localhost:9098/text-processing/openapi-doc-dygixywsw
Affected Versions:
Ballerina SwanLake Update 2201.9.0
The text was updated successfully, but these errors were encountered: