Azure / Azure/azure-openapi-validator

[PutRequestResponseSchemeArm] False positive due to bug in utils.isSchemaEqual()

Open
#752 1 comment 0 reactions 1 assignee Claimed by @AkhilaIlla View on GitHub
Dominant language
TypeScript
Stars
53
Forks
57
Avg merge
1d 23h
Merged PRs (30d)
2

Description

In this check run, run `PutRequestResponseSchemeArm` appears to fail with a false positive, since the schemas are indeed identical. I believe the bug is in helper function `utils.isSchemaEqual()`:

https://github.com/Azure/azure-openapi-validator/blob/edb65591d5ab85871f880e48b2ad6302186014b8/packages/rulesets/src/spectral/functions/utils.ts

![Image](https://github.com/user-attachments/assets/014c1931-555e-4550-871f-32dbb87d1774)

Even if the schemas are equal, if one of the property values is `null`, it will cause `isSchemaEqual()` to fail, which looks like a bug to me. Unless there's some reason this behavior was chosen intentionally.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.