Replies: 2 comments
-
@Jappinen Thanks for taking the time to bring this up. v1.2.0 came with a few large external contributions and I'm guessing that we missed some details during the review that are giving you this problem now I'll investigate this and see what I can do |
Beta Was this translation helpful? Give feedback.
-
Thanks for investigating. I looked a bit more into the nullable references docs and can see (and tested) that if I generated #nullable enable annotations The the warnings do not appear. According to the docs:
I'll include a fix for this in the upcoming v1.2.1 |
Beta Was this translation helpful? Give feedback.
-
Hello,
After updating from 1.1.3 to 1.2.0 my build output lit up like a Xmas tree with nullable property warnings. Take the simples possible Petstore sample for example (on fresh .NET 8 console project with everything as default as Rider sets them up):
...and continues for 27 lines. The culprit is the new "#nullable enable" line after usings and before namespace that was previously behind a flag (b13015b).
After a little bit of digging I found you discussed this on #435 and as per the docs (the blue box at the end of chapter) for generated code you really need to have that pragma in place to get the benefits.
In order to tell the underlying NSwag that you want nullables you need to opt-in: RicoSuter/NSwag#2435 (comment)
And like magic all my problems went away with the this:
So I guess what I'm trying to ask is shouldn't that be the default setting from now on or am I missing something blatantly obvious?
Beta Was this translation helpful? Give feedback.
All reactions