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

Default value for DateTime to avoid nullable #79

Open
mikthemonster opened this issue Nov 4, 2022 · 0 comments
Open

Default value for DateTime to avoid nullable #79

mikthemonster opened this issue Nov 4, 2022 · 0 comments

Comments

@mikthemonster
Copy link

Im getting a lot of errors related to this issue:

/// /// Please note: This property should have been non-nullable! Since the specification file /// does not include a default value (using the "default:" property), however, the generated /// source code must fall back to having a nullable type. /// Consider adding a "default:" property in the specification file to hide this note. ///

Im trying to set DefaultValues on every property in my .net Core 6 API to avoid nullable properties. It is working fine for strings, integers, boolean, but im not sure how to do it for DateTime?

I add this to my property in .net:

[DefaultValue(typeof(DateTime), "")]

I get this error in Flutter when running 'flutter pub run build_runner build --delete-conflicting-outputs' :

attribute components.schemas.GetOrderHeadersResponse.default=0001-01-01T00:00:00 is not of type date-time

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

No branches or pull requests

1 participant