Skip to content

[1.2.X] Fix with displaying param with map<anydata> subtypes as Payload params#282

Merged
NipunaRanasinghe merged 3 commits intoballerina-platform:1.2.xfrom
LakshanWeerasinghe:fix#1140
Sep 5, 2025
Merged

[1.2.X] Fix with displaying param with map<anydata> subtypes as Payload params#282
NipunaRanasinghe merged 3 commits intoballerina-platform:1.2.xfrom
LakshanWeerasinghe:fix#1140

Conversation

@LakshanWeerasinghe
Copy link
Contributor

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the display of parameters with map<anydata> subtypes as Payload parameters in the service model generator. The changes ensure that parameters that are subtypes of map<anydata> are correctly categorized as PAYLOAD parameters instead of QUERY parameters.

  • Added logic to detect map<anydata> subtypes and classify them as payload parameters
  • Updated test resources to include a new DateInfo record type and parameter
  • Added constant for HTTP_PARAM_TYPE_PAYLOAD

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
main.bal Added DateInfo parameter to anonReturn function and DateInfo record type definition
get_http_resource_model_6.json Added test configuration for dateInfo parameter with PAYLOAD type
Constants.java Added HTTP_PARAM_TYPE_PAYLOAD constant
HttpFunctionBuilder.java Implemented logic to detect map subtypes and set them as payload parameters

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@NipunaRanasinghe NipunaRanasinghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NipunaRanasinghe NipunaRanasinghe merged commit c25d7e7 into ballerina-platform:1.2.x Sep 5, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants