diff --git a/openapi-cli/src/test/resources/ballerina-to-openapi/expected_gen/parameter_annotation/annotated_payload_complex.yaml b/openapi-cli/src/test/resources/ballerina-to-openapi/expected_gen/parameter_annotation/annotated_payload_complex.yaml index 40a7de379..1f3cdd92d 100644 --- a/openapi-cli/src/test/resources/ballerina-to-openapi/expected_gen/parameter_annotation/annotated_payload_complex.yaml +++ b/openapi-cli/src/test/resources/ballerina-to-openapi/expected_gen/parameter_annotation/annotated_payload_complex.yaml @@ -68,6 +68,33 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorPayload' + /student3: + post: + operationId: postStudent3 + parameters: + - name: q + in: query + required: true + schema: + type: string + requestBody: + content: + text/plain: + schema: + type: string + responses: + "201": + description: Created + content: + application/json: + schema: + type: object + "400": + description: BadRequest + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorPayload' components: schemas: ErrorPayload: diff --git a/openapi-cli/src/test/resources/ballerina-to-openapi/parameter_annotation/annotated_payload_complex.bal b/openapi-cli/src/test/resources/ballerina-to-openapi/parameter_annotation/annotated_payload_complex.bal index af81e2fb5..03f49af28 100644 --- a/openapi-cli/src/test/resources/ballerina-to-openapi/parameter_annotation/annotated_payload_complex.bal +++ b/openapi-cli/src/test/resources/ballerina-to-openapi/parameter_annotation/annotated_payload_complex.bal @@ -14,4 +14,8 @@ service /payloadV on ep0 { resource function post student2(@http:Payload string p, string q) returns json { return {Name: p}; } + + resource function post student3(@http:Payload string? p, string q) returns json { + return {Name: p ?: q}; + } } diff --git a/openapi-cli/src/test/resources/ballerina-to-openapi/record/with_readonly_keyword.bal b/openapi-cli/src/test/resources/ballerina-to-openapi/record/with_readonly_keyword.bal index 3951fb22e..a4167d217 100644 --- a/openapi-cli/src/test/resources/ballerina-to-openapi/record/with_readonly_keyword.bal +++ b/openapi-cli/src/test/resources/ballerina-to-openapi/record/with_readonly_keyword.bal @@ -29,7 +29,7 @@ service /payloadV on new http:Listener(port) { } } - resource function post albums(@http:Payload Album album) returns Album { + resource function post albums(@http:Payload readonly & Album album) returns Album { albums.add(album); return album; }