Breeze / breeze-client

Breeze for JavaScript clients
MIT License
38 stars 16 forks source link

A nonnullable DataProperty cannot have a null defaultValue #50

Closed ganySA closed 3 years ago

ganySA commented 3 years ago

Hi

I seem to have this after the latest version.. It does it on every single property of my medadata.

Seems to be coming from here - my metadata has not changed.

                else {
                    this.defaultValue = this.dataType.defaultValue;
                    const msg = "A nonnullable DataProperty cannot have a null defaultValue. Name: " + (this.name || this.nameOnServer);
                    if (this.defaultValue === null) {
                        throw new Error(msg); // if defaultValue is explicity set to null, that's an error
                    }
                    else {
                        console.warn(msg); // if defaultValue is not set, that's a warning
                    }
                }
ganySA commented 3 years ago

A further comment my metaData does not contain defaultValue - i am using DBFirst with context generator for my classes. And can confirm that this is not in 2.0.7.

steveschmitt commented 3 years ago

Ugh, sorry! I overlooked that somehow in my testing. Thanks for letting me know right away.

ganySA commented 3 years ago

Any chance you can publish to npm?

steveschmitt commented 3 years ago

Fixed in release 2.1.1.