Azure / autorest

OpenAPI (f.k.a Swagger) Specification code generator. Supports C#, PowerShell, Go, Java, Node.js, TypeScript, Python
MIT License
4.6k stars 733 forks source link

Improve error message if "parameters" contains "$ref" #4961

Open mikeharder opened 5 months ago

mikeharder commented 5 months ago

PR https://github.com/Azure/azure-rest-api-specs/pull/28160 is failing LintDiff with this error:

"!Error: Invalid Reference file: -- file:///mnt/vss/_work/1/azure-rest-api-specs/specification/common-types/resource-management/v5/types.json#/components/parameters/ApiVersionParameter"

We believe this is because the spec uses $ref under section parameters which is not allowed per the OAS2 spec.

AutoRest should try to improve this error message, to give spec authors more information what is wrong with their spec.

Teams discussion: https://teams.microsoft.com/l/message/19:4f661242c446452e895359cc3ef45125@thread.tacv2/1714671337559?tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&groupId=0cab4ce9-7691-42ae-82e3-460d4346a710&parentMessageId=1714671337559&teamName=ARM%20API%20Reviewers&channelName=ARM%20linter%20rules&createdTime=1714671337559&allowXTenantAccess=false