Closed yvo-niedrich closed 4 months ago
Agreed, they should have been filtered out if they're computed according to https://docs.oasis-open.org/odata/odata/v4.01/os/part1-protocol/odata-v4.01-os-part1-protocol.html#sec_CreateanEntity
Happy to merge a fix if you have one : )
Happy to merge a fix if you have one : )
Will prepare in the next couple of days...
I do assume this will be introducing breaking changes though (in terms of Library Behaviour)
When overloading some classes I need to suppress psalm errors for invalid return types, when they are actually correct:
Changes
GeneratedProperty::invoke
does expect aPrimitive
(but it is able to convert scalar types itself)EloquentEntitySet::read
should correctly implement and comply with theReadInterface
it implementsAdded an argument to annotate properties as
immutable
eg:#[LodataString(name: 'Type', source: 'type', immutable: true)]
Comments
I'm still looking into the immutable aspect of the library because I feel
Immutable
,Computed
andComputedDefaultValue
are implemented too loosely (vocabulary here):I've defined a property as computed and the OpenAPI specification looks good, the property is not defined for Create- or Update operations. But it is accepted and passed on as in the arguments nonetheless - so in my case the user is able to manipulate computed attributes like the
updated
date, by just providing a value in their PATCH request 🤔