diff --git a/openapi-cli/src/test/resources/ballerina-to-openapi/expected_gen/record/record_field_with_name_annotation.yaml b/openapi-cli/src/test/resources/ballerina-to-openapi/expected_gen/record/record_field_with_name_annotation.yaml index 730bb4a6c..e83d33065 100644 --- a/openapi-cli/src/test/resources/ballerina-to-openapi/expected_gen/record/record_field_with_name_annotation.yaml +++ b/openapi-cli/src/test/resources/ballerina-to-openapi/expected_gen/record/record_field_with_name_annotation.yaml @@ -44,6 +44,25 @@ paths: $ref: "#/components/schemas/ErrorPayload" post: operationId: postAlbums + parameters: + - name: X-API-VERSION + in: header + required: true + schema: + type: string + - name: X-CORRELATION-ID + in: header + required: true + schema: + type: integer + format: int64 + - name: ids + in: header + required: true + schema: + type: array + items: + type: string requestBody: content: application/json: diff --git a/openapi-cli/src/test/resources/ballerina-to-openapi/record/record_field_with_name_annotation.bal b/openapi-cli/src/test/resources/ballerina-to-openapi/record/record_field_with_name_annotation.bal index dea33d722..64a7b11bd 100644 --- a/openapi-cli/src/test/resources/ballerina-to-openapi/record/record_field_with_name_annotation.bal +++ b/openapi-cli/src/test/resources/ballerina-to-openapi/record/record_field_with_name_annotation.bal @@ -5,7 +5,7 @@ import ballerina/http; type OASServiceType service object { *http:ServiceContract; resource function get albums(string[] artists = [], @http:Header {name: "X-API-VERSION"} string? xAPIVERSION = "v1") returns Album[]; - resource function post albums(Album payload) returns Album; + resource function post albums(@http:Header Headers headers, Album payload) returns Album; resource function get albums/[string id]() returns Album; }; @@ -18,3 +18,11 @@ public type Album record {| @jsondata:Name {value: titleField} string title; |}; + +public type Headers record {| + @http:Header {name: "X-API-VERSION"} + string apiVersion; + @http:Header {name: "X-CORRELATION-ID"} + int correlationId; + string[] ids; +|};