Skip to content

[SourceGen] Bug fix for scenarios with $return output binding#2098

Merged
satvu merged 3 commits intomainfrom
satvu/source-gen-bug
Nov 28, 2023
Merged

[SourceGen] Bug fix for scenarios with $return output binding#2098
satvu merged 3 commits intomainfrom
satvu/source-gen-bug

Conversation

@satvu
Copy link
Copy Markdown
Member

@satvu satvu commented Nov 27, 2023

Issue describing the changes in this PR

resolves #2073

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • I have added all required tests (Unit tests, E2E tests)

Additional information

For HttpTrigger functions with a method attribute output binding, we need to drop the http-related output binding. Example of legacy metadata:

[
  {
    "name": "Function1",
    "scriptFile": "FunctionApp154.dll",
    "entryPoint": "FunctionApp154.Function1.Run",
    "language": "dotnet-isolated",
    "properties": {
      "IsCodeless": false
    },
    "bindings": [
      {
        "name": "req",
        "direction": "In",
        "type": "httpTrigger",
        "authLevel": "Function",
        "methods": [
          "get",
          "post"
        ],
        "properties": {}
      },
      {
        "name": "$return",
        "direction": "Out",
        "type": "queue",
        "queueName": "myqueue",
        "connection": "Con",
        "properties": {}
      }
    ]
  }
]

Another case added to the tests is an HttpTrigger function with a custom return type that does not include a property of the type HttpRequestData. In this case, the http-related output binding is also dropped.

@satvu satvu marked this pull request as ready for review November 27, 2023 20:17
@satvu satvu requested a review from brettsam November 27, 2023 20:19
@satvu satvu merged commit 5ee6e55 into main Nov 28, 2023
@satvu satvu deleted the satvu/source-gen-bug branch November 28, 2023 21:36
@satvu satvu mentioned this pull request Nov 30, 2023
7 tasks
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.

Only one output binding is supported when using a binding assigned to '$return'

3 participants