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

LintDiff: Need equivalent of PatchBodyParametersSchema rule so we can disable #406

Open
tjprescott opened this issue Mar 12, 2024 · 2 comments
Assignees
Milestone

Comments

@tjprescott
Copy link
Member

https://github.com/Azure/azure-openapi-validator/blob/main/docs/patch-body-parameters-schema.md

@tjprescott
Copy link
Member Author

tjprescott commented Apr 30, 2024

Here's the issue that is needed to unblock this: microsoft/typespec#3012

The reason is that this rule exists in typespec-azure-core but in order to do the necessary validation, we need to know that Foo processed through an update and the HTTP metadata system actually comes out as a FooUpdate and that is what we need to run this validation on.

Possible alternative (but bad) options:

  • Somehow get the rule to recreate the logic that applies and transforms the model into its derived version in order to validate it. The problem here is that in OpenAPI that logic is intimately intertwined with the OpenAPI syntax generation, so that would be problematic and would generate two parallel code paths that try to do the same thing, but likely don't, meaning that the rule can't guarantee to protect against generating the wrong thing.
  • Make this a rule in the OpenAPI library. The problems here are the 1) the library doesn't have any ruleset and 2) this is an Azure-specific rule, but the OpenAPI library is intended to be Azure-agnostic.

@tjprescott
Copy link
Member Author

This is also blocked because it would require ARM approval since it applies to DataPlane and ARM specs.

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