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] Handle default values in binding attributes #1131

Merged
merged 12 commits into from
Nov 9, 2022

Conversation

satvu
Copy link
Member

@satvu satvu commented Oct 18, 2022

Issue describing the changes in this PR

resolves #1101

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)

Currently, only EventHubsTrigger has a property with "DefaultValue" on it. This PR additionally standardizes casing for bindings on the source-generated file by choosing PascalCase when creating fields on the anonymous types we represent bindings with (before serializing them).

Values taken from properties with DefaultValue attributes keep their casing, and values whose names come from constructor parameters will uppercase the first letter.

@satvu satvu force-pushed the satvu/handle-default-binding-values-sourcegen branch from 8d65547 to 5dd7a7a Compare October 21, 2022 18:31
@satvu satvu marked this pull request as ready for review October 21, 2022 22:23
@satvu satvu requested review from jviau and kshyju October 21, 2022 22:23
@satvu satvu force-pushed the satvu/handle-default-binding-values-sourcegen branch from 10c8a5a to e235854 Compare November 1, 2022 17:47
@satvu satvu requested a review from jviau November 1, 2022 18:22
sdk/Sdk.Generators/Extensions/StringExtensions.cs Outdated Show resolved Hide resolved
@satvu
Copy link
Member Author

satvu commented Nov 9, 2022

/check-enforcer evaluate

@satvu satvu merged commit 320be4e into main Nov 9, 2022
@satvu satvu deleted the satvu/handle-default-binding-values-sourcegen branch November 9, 2022 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle DefaultValueAttribute when building function metadata in GeneratedFunctionMetadataProvider
2 participants