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

[SourceGen] Add support for overriding binding property name #1130

Merged
merged 5 commits into from
Oct 20, 2022

Conversation

satvu
Copy link
Member

@satvu satvu commented Oct 18, 2022

Issue describing the changes in this PR

resolves #1087

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

Example usage of the attribute that overrides binding property names.

On the issue thread you can find a comment on the design assumptions. Given the limitations of Roslyn analyzers, this design relies on the convention that attribute constructor parameter names will match the name of the property they are assigned to (matching is NOT case-sensitive).

@@ -236,7 +236,7 @@ public Task<ImmutableArray<IFunctionMetadata>> GetFunctionMetadataAsync(string d
name = 'blob',
type = 'BlobTrigger',
direction = 'In',
blobPath = 'container2/%file%',
path = 'container2/%file%',
Copy link
Member Author

Choose a reason for hiding this comment

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

This test has been changed to reflect that blob triggers should have an arg name of "path", not "blobPath". In line 201 above for the Blob output binding, we still keep the arg name "blobPath".

Blob bindings classess for reference.

@satvu satvu marked this pull request as ready for review October 18, 2022 18:26
@satvu satvu requested review from jviau, kshyju, fabiocav and brettsam and removed request for jviau October 18, 2022 18:26
Copy link
Contributor

@jviau jviau left a comment

Choose a reason for hiding this comment

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

Looks good - just some minor suggestions.

@satvu
Copy link
Member Author

satvu commented Oct 20, 2022

/check-enforcer evaluate

@satvu satvu merged commit 6880c19 into main Oct 20, 2022
@satvu satvu deleted the satvu/override-bindingprop-sourcegen branch October 20, 2022 17:07
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.

Adding support for overriding the binding property name in function metadata - SourceGen provider
3 participants