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

[PatchBodyParameterSchema] Improve error message from nested properties #708

Open
mikeharder opened this issue Jun 12, 2024 · 0 comments
Open
Assignees

Comments

@mikeharder
Copy link
Member

mikeharder commented Jun 12, 2024

If rule PatchBodyParameterSchema fails, the error message only includes the name of the property and the top-level reference that contains the nested property:

PatchBodyParametersSchema Properties of a PATCH request body must not be required, property:type.
Location: Microsoft.AVS/stable/2023-09-01/vmware.json#L489 RPC-Patch-V1-10
PatchBodyParametersSchema Properties of a PATCH request body must not be required, property:name.
Location: Microsoft.AVS/stable/2023-09-01/vmware.json#L489 RPC-Patch-V1-10
PatchBodyParametersSchema Properties of a PATCH request body must not be required, property:name.
Location: Microsoft.AVS/stable/2023-09-01/vmware.json#L1609 RPC-Patch-V1-10

https://github.com/Azure/azure-rest-api-specs/pull/28023/checks?check_run_id=22174134612

This can be very difficult to debug, especially if the property is nested multiple levels or is under common-types which spec authors asssume are 100% correct.

Can the rule be improved to show the original source location of the violation? Or a "call stack" of $refs?

I'm unsure if this behavior is specific to PatchBodyParameterSchema, or applies to many (or all) rules.

@mikeharder mikeharder changed the title [PatchBodyParameterSchema] [PatchBodyParameterSchema] Improve error message from nested properties Jun 12, 2024
@mikeharder mikeharder self-assigned this Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant