Closed yvo-niedrich closed 1 month ago
Found the docker
command to boot up mongo - all test snapshots are updated now: Generated
properties are listed in the OpenAPI documentation when describing an Entity.
Ready for merge (in my opinion)
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 Computed
, not ComputedDefaultValue
- would you mind making that change as part of this?
Ah, I believe I see what you mean. This one for example - right?
I'll go ahead and completely separate Computed
from ComputedDefault
in the types then... Will do tomorrow.
In https://github.com/flat3/lodata/blob/be527e5a941fb4f9640778446002981823daed19/src/Drivers/EloquentEntitySet.php#L680
and https://github.com/flat3/lodata/blob/be527e5a941fb4f9640778446002981823daed19/src/Drivers/CSVEntityType.php#L21 for example, the standard drivers should be using Computed
here.
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.
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