Closed siarhei-murkou closed 1 month ago
Hi Siarhei,
thanks for providing this addition! Looks good on first glance, but there seem to be no tests covering this new behaviour as of now. Can you please add a test checking a mandatory vs a non-mandatory field? A more approachable way of testing has been added recently, where you basically have to write consuming TS code for your generated files. Let me know when you need help writing this test.
Best, Daniel
Also, as I have learned today, this feature may still slightly change in the near future. So let's maybe shelf this for now until we know with certainty how @mandatory
and not null
will turn out.
Also, as I have learned today, this feature may still slightly change in the near future. So let's maybe shelf this for now until we know with certainty how
@mandatory
andnot null
will turn out.
Hi Daniel, sorry for late response! 😞
Okay, I see.. Lets then wait for the final decision by cds runtime team. 🙂 I suppose, right now this PR might be closed...
So far, I'm using @mandatory
together with not null
as a workaround.
Hi @daogrady 👋 ,
Since the version
8.0.2
, CDS has introduced the new logic for CDS params in CDS functions/actions. Now, we have to use@mandatory
annotation instead of settingnot null
keyword. Whereasnot null
is still working on CDS entity layer.. Therefore, I have added a check on@mandatory
existence in order to determine if the property should/shouldn't be marked as nullable in the compiled TypeScript files.