Azure / azure-api-style-guide

Spectral rules to check conformance to Azure API Guidelines
MIT License
45 stars 21 forks source link

Fix property default not allowed #125

Closed mikekistler closed 1 year ago

mikekistler commented 1 year ago

This PR fixes a bug in the propertyDefaultNotAllowed function that attempted to reference into properties without first ensuring it was defined. The fix is to use optional chaining. I also added a test (as the first commit) to reproduce the problem.