{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/OpenAPI.NET/issues/287","repository_url":"https://api.github.com/repos/Microsoft/OpenAPI.NET","labels_url":"https://api.github.com/repos/Microsoft/OpenAPI.NET/issues/287/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/OpenAPI.NET/issues/287/comments","events_url":"https://api.github.com/repos/Microsoft/OpenAPI.NET/issues/287/events","html_url":"https://github.com/Microsoft/OpenAPI.NET/issues/287","id":333871306,"node_id":"MDU6SXNzdWUzMzM4NzEzMDY=","number":287,"title":"Callback key can be a string with embedded RuntimeExpression","user":{"login":"PerthCharern","id":26418622,"node_id":"MDQ6VXNlcjI2NDE4NjIy","avatar_url":"https://avatars1.githubusercontent.com/u/26418622?v=4","gravatar_id":"","url":"https://api.github.com/users/PerthCharern","html_url":"https://github.com/PerthCharern","followers_url":"https://api.github.com/users/PerthCharern/followers","following_url":"https://api.github.com/users/PerthCharern/following{/other_user}","gists_url":"https://api.github.com/users/PerthCharern/gists{/gist_id}","starred_url":"https://api.github.com/users/PerthCharern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PerthCharern/subscriptions","organizations_url":"https://api.github.com/users/PerthCharern/orgs","repos_url":"https://api.github.com/users/PerthCharern/repos","events_url":"https://api.github.com/users/PerthCharern/events{/privacy}","received_events_url":"https://api.github.com/users/PerthCharern/received_events","type":"User","site_admin":false},"labels":[{"id":646630508,"node_id":"MDU6TGFiZWw2NDY2MzA1MDg=","url":"https://api.github.com/repos/Microsoft/OpenAPI.NET/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":{"login":"darrelmiller","id":447694,"node_id":"MDQ6VXNlcjQ0NzY5NA==","avatar_url":"https://avatars2.githubusercontent.com/u/447694?v=4","gravatar_id":"","url":"https://api.github.com/users/darrelmiller","html_url":"https://github.com/darrelmiller","followers_url":"https://api.github.com/users/darrelmiller/followers","following_url":"https://api.github.com/users/darrelmiller/following{/other_user}","gists_url":"https://api.github.com/users/darrelmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/darrelmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darrelmiller/subscriptions","organizations_url":"https://api.github.com/users/darrelmiller/orgs","repos_url":"https://api.github.com/users/darrelmiller/repos","events_url":"https://api.github.com/users/darrelmiller/events{/privacy}","received_events_url":"https://api.github.com/users/darrelmiller/received_events","type":"User","site_admin":false},"assignees":[{"login":"darrelmiller","id":447694,"node_id":"MDQ6VXNlcjQ0NzY5NA==","avatar_url":"https://avatars2.githubusercontent.com/u/447694?v=4","gravatar_id":"","url":"https://api.github.com/users/darrelmiller","html_url":"https://github.com/darrelmiller","followers_url":"https://api.github.com/users/darrelmiller/followers","following_url":"https://api.github.com/users/darrelmiller/following{/other_user}","gists_url":"https://api.github.com/users/darrelmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/darrelmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darrelmiller/subscriptions","organizations_url":"https://api.github.com/users/darrelmiller/orgs","repos_url":"https://api.github.com/users/darrelmiller/repos","events_url":"https://api.github.com/users/darrelmiller/events{/privacy}","received_events_url":"https://api.github.com/users/darrelmiller/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-06-19T23:15:14Z","updated_at":"2018-08-16T22:49:12Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"@darrelmiller \r\n\r\nIssue from @epet, @Shwetap05 \r\n\r\nCurrently we only allow RuntimeExpression in a key in a Callback object.\r\n\r\n```csharp\r\n        /// <summary>\r\n        /// A Path Item Object used to define a callback request and expected responses.\r\n        /// </summary>\r\n        public Dictionary<RuntimeExpression, OpenApiPathItem> PathItems { get; set; }\r\n            = new Dictionary<RuntimeExpression, OpenApiPathItem>();\r\n```\r\n\r\nThis is not correct given an example in the spec: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#callback-object-example\r\n\r\n```\r\nmyWebhook:\r\n  'http://notificationServer.com?transactionId={$request.body#/id}&email={$request.body#/email}':\r\n    post:\r\n      requestBody:\r\n        description: Callback payload\r\n        content: \r\n          'application/json':\r\n            schema:\r\n              $ref: '#/components/schemas/SomePayload'\r\n      responses:\r\n        '200':\r\n          description: webhook successfully processed and no retries will be performed\r\n```\r\n\r\nNote that the \"expression\" key above is a URL with RuntimeExpression embedded in. \r\n\r\nNote: I think the spec is a bit ambiguous. The spec states this: \"The key that identifies the Path Item Object is a runtime expression that can be evaluated in the context of a runtime HTTP request/response to identify the URL to be used for the callback request.\" \r\n\r\nThe runtime expression in the spec is strictly defined. There's a bit of leeway with this sentence \"Runtime expressions preserve the type of the referenced value. Expressions can be embedded into string values by surrounding the expression with {} curly braces.\", but this sentence is in the Examples section of runtime expression section and it contradicts with the definition of runtime expression directly above: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#examples-1\r\n\r\nI would say we are actually faithful to the spec with the current implementation - though probably not aligned with the spirit of the spec."},"comment":{"url":"https://api.github.com/repos/Microsoft/OpenAPI.NET/issues/comments/413707344","html_url":"https://github.com/Microsoft/OpenAPI.NET/issues/287#issuecomment-413707344","issue_url":"https://api.github.com/repos/Microsoft/OpenAPI.NET/issues/287","id":413707344,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzcwNzM0NA==","user":{"login":"PerthCharern","id":26418622,"node_id":"MDQ6VXNlcjI2NDE4NjIy","avatar_url":"https://avatars1.githubusercontent.com/u/26418622?v=4","gravatar_id":"","url":"https://api.github.com/users/PerthCharern","html_url":"https://github.com/PerthCharern","followers_url":"https://api.github.com/users/PerthCharern/followers","following_url":"https://api.github.com/users/PerthCharern/following{/other_user}","gists_url":"https://api.github.com/users/PerthCharern/gists{/gist_id}","starred_url":"https://api.github.com/users/PerthCharern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PerthCharern/subscriptions","organizations_url":"https://api.github.com/users/PerthCharern/orgs","repos_url":"https://api.github.com/users/PerthCharern/repos","events_url":"https://api.github.com/users/PerthCharern/events{/privacy}","received_events_url":"https://api.github.com/users/PerthCharern/received_events","type":"User","site_admin":false},"created_at":"2018-08-16T22:49:12Z","updated_at":"2018-08-16T22:49:12Z","author_association":"CONTRIBUTOR","body":"There's a bug in the expression parser. We are checking for `{$` to determine if it's a composite expression. If the expression is a simple string like `/abcd`, then we are not parsing it correctly."}}
{"actor":{"display_login":"PerthCharern"}}