Open zminot opened 1 month ago
Related, why does our own sample use ArmCustomPatchSync
instead of ArmResourcePatchSync
? Shouldn't our sample use the highest-level built-in types?
update is ArmCustomPatchSync<
Employee,
Azure.ResourceManager.Foundations.ResourceUpdateModel<
Employee,
EmployeeProperties
>
>;
Part of this is by design, and part is a bug
If all of the properties of a model are optional (
?
) and usingArmResourcePatchSync
/Async
, the emitter will not define and emit a new Update model to represent the PATCH operation. This results in what I think is improper spec (or, at least, azure-openapi-validator complains about it).Playground Link
In the above playground, the patch expects the
EmployeeUpdate
which containsEmployeeProperties
and theManagedServiceIdentityUpdate
. However, the properties ofEmployeeProperties
are all create/read-only properties. Removing the nullability of one of the properties--say, age--will instead prompt the emittance ofEmployeeUpdate
containingEmployeePropertiesUpdate
, which in turn is defined with no properties (as nothing fromEmployeeProperties
should be able to be updated.Not sure if this improper definition by us, though. We're running into RPC-Patch-V1-02 and RPC-Patch-V1-10 because of this.