-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update behaviour for immutable
and computed
properties
#837
Conversation
…on for `computed` and `immutable` properties
104f145
to
8cf08df
Compare
…mputedDefault` properties with the create schema
…luminate\Request`
…ute` adds support for external model mutations and polymorphism.
… are defined for the entity in OpenAPI documentation)
Found the Ready for merge (in my opinion) |
Bugfix: EloquentEntitySet::create - comply with source attribute (when configured)
Hi @yvo-niedrich, thanks for the work! On the computed default properties I'm not sure it's correct to indicate those can be provided during a create operation, as they are still computed by the server and not the client? |
Ah, no you're right, "A value for this property can be provided by the client on insert and update. If no value is provided on insert, a non-static default value is generated" |
and in that case, the entity set drivers right now are incorrectly annotating with |
Ah, I believe I see what you mean. This one for example - right? I'll go ahead and completely separate |
In lodata/src/Drivers/EloquentEntitySet.php Line 680 in be527e5
and lodata/src/Drivers/CSVEntityType.php Line 21 in be527e5
Computed here.
|
… `ComputedDefault` to `Computed`
EPC-11157: validate `Guid` values (and return a proper HTTP 400)
Had some time to spare and updated the PR already 🙈 I've also included another change (again thanks to @sean-james-eco) to properly validate UUIDs. Now a 400 error is returned - instead of the DatabaseException (HTTP 500) when the Eloquent Driver tries to write an invalid value to the database. |
…tAcceptedContentTypes`
Hey @27pchrisl are we still missing some of the updates you mentioned? I thought I caught them all 🤔 |
@yvo-niedrich Nope! I just hadn't got round to reading all the changes : ) I'll tag shortly... |
OpenAPI Documentation
computed
properties in the Create-OpenApi, if it is also annotated asComputedDefaultValue
immutable
properties in the Update-OpenApiGeneratedProperties
(in addition toDeclared
) when generating the Entity OpenAPI documentationProperty Filtering
computed
fields from create operations, unless the property is also annotated asComputedDefaultValue
computed
fields from update operationsAnnotations
Enum
can be annotated asnullable
andimmutable
Changes
Computed
- instead ofComputedDefault
Guid
properties are properly validated (thanks @sean-james-eco)Bugfixes
$cookie
property of a request when convertingIlluminate\Request
. Fixes"Request::$cookies must not be accessed before initialization"
when Telescope and APP_DEBUG are enabled.EloquentEntitySet::create
complies withattribute.source
for navigation source (thanks @sean-james-eco)boot
with Laravel 11.x