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

Make OutputConstructorAttribute optional #438

Open
rosieks opened this issue Dec 30, 2024 · 0 comments
Open

Make OutputConstructorAttribute optional #438

rosieks opened this issue Dec 30, 2024 · 0 comments
Labels
area/sdks kind/enhancement Improvements or new features

Comments

@rosieks
Copy link

rosieks commented Dec 30, 2024

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

Make OutputConstructorAttribute mandatory only if there is more than one constructor. The goal is to make make it easy to use records with primary constructor like that:

[OutputType]
public record SomeOutput(string Value1, string Value2);

Right now such code throw exception like this:

System.InvalidOperationException: SomeOutput had [OutputTypeAttribute], but did not contain constructor marked with [OutputConstructorAttribute].

Affected area/feature

SDK / Serialization

@rosieks rosieks added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Dec 30, 2024
@justinvp justinvp added area/sdks and removed needs-triage Needs attention from the triage team labels Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sdks kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

2 participants