odata2ts
odata2ts copied to clipboard
[Enhancement suggestion] Better managed property detection by checking annotations
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.