Skip to content
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

When all model properties are optional, ArmPatchResourceSync/Async will not emit a new Update model #1586

Open
zminot opened this issue Sep 20, 2024 · 0 comments

Comments

@zminot
Copy link
Member

zminot commented Sep 20, 2024

If all of the properties of a model are optional (?) and using ArmPatchResourceSync/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 contains EmployeeProperties and the ManagedServiceIdentityUpdate. However, the properties of EmployeeProperties are all create/read-only properties. Removing the nullability of one of the properties--say, age--will instead prompt the emittance of EmployeeUpdate containing EmployeePropertiesUpdate, which in turn is defined with no properties (as nothing from EmployeeProperties 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant