{"action":"opened","issue":{"url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/12518","repository_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang","labels_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/12518/labels{/name}","comments_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/12518/comments","events_url":"https://api.github.com/repos/ballerina-platform/ballerina-lang/issues/12518/events","html_url":"https://github.com/ballerina-platform/ballerina-lang/issues/12518","id":387739166,"node_id":"MDU6SXNzdWUzODc3MzkxNjY=","number":12518,"title":"Swagger: Inconsistency between service .bal file and .bal file created back from yaml","user":{"login":"ChinthakaSenanayaka","id":2564122,"node_id":"MDQ6VXNlcjI1NjQxMjI=","avatar_url":"https://avatars1.githubusercontent.com/u/2564122?v=4","gravatar_id":"","url":"https://api.github.com/users/ChinthakaSenanayaka","html_url":"https://github.com/ChinthakaSenanayaka","followers_url":"https://api.github.com/users/ChinthakaSenanayaka/followers","following_url":"https://api.github.com/users/ChinthakaSenanayaka/following{/other_user}","gists_url":"https://api.github.com/users/ChinthakaSenanayaka/gists{/gist_id}","starred_url":"https://api.github.com/users/ChinthakaSenanayaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChinthakaSenanayaka/subscriptions","organizations_url":"https://api.github.com/users/ChinthakaSenanayaka/orgs","repos_url":"https://api.github.com/users/ChinthakaSenanayaka/repos","events_url":"https://api.github.com/users/ChinthakaSenanayaka/events{/privacy}","received_events_url":"https://api.github.com/users/ChinthakaSenanayaka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-05T12:41:45Z","updated_at":"2018-12-05T12:41:45Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"**Description:**\r\nCreate swagger yaml from service bal file. Then created services bal file from that swagger file are not equal.\r\n\r\n**Steps to reproduce:**\r\nhellow_world_service.bal\r\nimport ballerina/http;\r\nimport ballerina/log;\r\n\r\n// By default, Ballerina exposes a service via HTTP/1.1.\r\nservice hello on new http:Listener(9091) {\r\n\r\n    // Invoke all resources with arguments of server connector and request.\r\n    resource function sayHello(http:Caller caller, http:Request req) {\r\n        http:Response res = new;\r\n        // Use a util method to set a string payload.\r\n        res.setPayload(\"Hello, World!\");\r\n\r\n        // Send the response back to the caller.\r\n\r\n        var result = caller->respond(res);\r\n        if (result is error) {\r\n            log:printError(\"Error sending response\", err = result);\r\n        }\r\n    }\r\n}\r\n\r\nCreated swagger file:\r\nhello_world_service.swagger.yaml\r\nopenapi: 3.0.1\r\ninfo:\r\n  title: hello\r\n  version: 1.0.0\r\nservers:\r\n- url: /hello\r\npaths:\r\n  /sayHello: {}\r\ncomponents: {}\r\n\r\nbal file created from the swagger yaml (hello.bal): \r\nimport ballerina/http;\r\nimport ballerina/log;\r\nimport ballerina/mime;\r\nimport ballerina/swagger;\r\n\r\nlistener http:Listener ep0 = new(9090);\r\n\r\n@swagger:ServiceInfo {\r\n    title: \"hello\",\r\n    serviceVersion: \"1.0.0\"\r\n}\r\n@http:ServiceConfig {\r\n    basePath: \"/\"\r\n}\r\nservice hello on ep0 {\r\n    resource function sayHello (http:Caller outboundEp, http:Request _sayHelloReq) {\r\n        http:Response _sayHelloRes = new;\r\n        string _sayHelloPayload = \"Sample sayHello Response\";\r\n        _sayHelloRes.setTextPayload(_sayHelloPayload);\r\n        _ = outboundEp->respond(_sayHelloRes);\r\n    }\r\n\r\n}\r\n\r\nhellow_world_service.bal service is at GET http://0.0.0.0:9090/hello/sayHello\r\nhello.bal service is at GET http://0.0.0.0:9090/sayHello\r\n\r\n**Affected Versions:**\r\nballerina-0.983.1-SNAPSHOT or 0.990.0-rc1\r\n\r\n**OS, DB, other environment details and versions:**\r\n\r\n**Related Issues (optional):**\r\n<!-- Any related issues such as sub tasks, issues reported in other repositories (e.g component repositories), similar problems, etc. -->\r\n\r\n**Suggested Labels (optional):**\r\n<!-- Optional comma separated list of suggested labels. Non committers can’t assign labels to issues, so this will help issue creators who are not a committer to suggest possible labels-->\r\n\r\n**Suggested Assignees (optional):**\r\n<!--Optional comma separated list of suggested team members who should attend the issue. Non committers can’t assign issues to assignees, so this will help issue creators who are not a committer to suggest possible assignees-->\r\n"}}
{"actor":{"display_login":"ChinthakaSenanayaka"}}