Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide mapping to application/x-www-form-urlencoded when it has response and request body in resources #5391

Closed
2 tasks done
lnash94 opened this issue Feb 17, 2022 · 0 comments · Fixed by ballerina-platform/openapi-tools#926

Comments

@lnash94
Copy link
Member

lnash94 commented Feb 17, 2022

Description:
Currently, the default mapping for map is application/json. Therefore, when generating OpenAPI for x-www-form-urlecnoded the service should be as follows. Basically we need to override the default content-type.

// this maps to x-www-form-urlencoded
service / on new http:Listener(9000) {
    resource function get foo(@http:Payload { mediaType: mime:APPLICATION_FORM_URLENCODED} map<string> keyvalue) 
            returns @http:Payload { mediaType: mime:APPLICATION_FORM_URLENCODED} map<string> {
        
    }
}
  • RequestBody Mapping
  • Response Mapping

Describe your problem(s)

Describe your solution(s)

Related Issues (optional):
#1705

Suggested Labels (optional):

Suggested Assignees (optional):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment