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

Readonly properties are no longer readonly when using backing store #499

Open
rangp opened this issue Dec 19, 2024 · 0 comments
Open

Readonly properties are no longer readonly when using backing store #499

rangp opened this issue Dec 19, 2024 · 0 comments

Comments

@rangp
Copy link

rangp commented Dec 19, 2024

While generating a c# client with kiota version 1.21.0, I noticed that readonly properties are no longer readonly when using a backing store.

My readonly property was generated like this:

public double? AveragePriceGross { get; private set; }

After re-generating the client with a backing store, it now looks like this and I can set the property, even though it is marked as readonly in my api definition

        public double? AveragePriceGross
        {
            get { return BackingStore?.Get<double?>("average_price_gross"); }
            set { BackingStore?.Set("average_price_gross", value); }
        }

I understand that with backing store enabled, one can always change the property by manually changing the value in the underlying store, but I think the behavior should be consistent and the generated properties should either always or never be readonly, independent of whether a backing store is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage 🔍
Development

No branches or pull requests

1 participant