not null Fields, that are not required

We have some fields, which contains values set by sequences that are not ID fields.
These Fields should be not null in Database but not marked as Required in Swagger.

So Applications do not have to send these fields using XData.

How could this be handled without using a second Entity?

In this case, shouldn't your entity members be Nullable? Because then you can make a difference to tell if the field is set or not in case you want to update or insert.

I would change the entity field to Nullable and then add the TColumnProp.Required flag to them so it's still not null in database.

(I moved this question from Aurelius to XData category, as this is XData-related).

You're absolutely right, it should be nullable and use TColumnProp.Required.

But, how to avoid that this column will appear in x-required in swagger?

If the type is Nullable, it won't be marked as required in Swagger.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.