odata2ts icon indicating copy to clipboard operation
odata2ts copied to clipboard

[Enhancement suggestion] Better managed property detection by checking annotations

Open akudev opened this issue 1 year ago • 0 comments

Managed properties are automatically detected and excluded from EditableXY types, but this detection is so far very basic, only covering single-key fields, as described at https://odata2ts.github.io/docs/generator/managed-props

At least in SAP environments with CDS, the detection could be improved by looking at the annotations. E.g. the properties "createdAt" "modifiedBy" etc. for which the manual exclusion is demonstrated in the documentation could all be automatically detected as being managed and unchangeable by checking whether the "Core.Computed" annotation is "true". See https://cap.cloud.sap/docs/guides/providing-services#readonly

Further annotations might also help, like "Core.Readonly" and "Core.Immutable" (only for updates - this would require a differentioation of the editable types between creation and updates), but at least they are not present in the most basic example services.

akudev avatar Mar 10 '23 12:03 akudev