-
Notifications
You must be signed in to change notification settings - Fork 142
Closed
Description
Although many parsers may tolerate HTTP Response Codes as being a number it violates the OpenAPISpec 3.0 which specifies it as a string and is an easy fix.
Reference Documentation
Rule Details
Looking for agreement to raise a trivial PR to bring this into alignment with all other Xero yaml specs (which correctly implement them as a string eg. "200" vs 200.
I have a validator which highlights the error:
β Xero-OpenAPI git:(feat-spectral-linter) β ./validate-all.sh
π Validating all Xero OpenAPI specifications...
================================================
Testing 11 OpenAPI specification files...
π Validating xero-identity.yaml...
β
xero-identity.yaml - PASSED
π Validating xero-projects.yaml...
β
xero-projects.yaml - PASSED
π Validating xero-app-store.yaml...
β
xero-app-store.yaml - PASSED
π Validating xero-payroll-uk.yaml...
β
xero-payroll-uk.yaml - PASSED
π Validating xero_files.yaml...
β
xero_files.yaml - PASSED
π Validating xero_accounting.yaml...
β
xero_accounting.yaml - PASSED
π Validating xero-payroll-nz.yaml...
β
xero-payroll-nz.yaml - PASSED
π Validating xero_assets.yaml...
β
xero_assets.yaml - PASSED
π Validating xero-finance.yaml...
β xero-finance.yaml - FAILED
Running detailed check:
/Users/~/Xero-OpenAPI/xero-finance.yaml
392:9 error parser Mapping key must be a string scalar rather than number paths./FinancialStatements/BalanceSheet.get.responses[200]
456:9 error parser Mapping key must be a string scalar rather than number paths./FinancialStatements/BalanceSheet.get.responses[400]
467:9 error parser Mapping key must be a string scalar rather than number paths./FinancialStatements/BalanceSheet.get.responses[503]
506:9 error parser Mapping key must be a string scalar rather than number paths./FinancialStatements/Cashflow.get.responses[200]
610:9 error parser Mapping key must be a string scalar rather than number paths./FinancialStatements/Cashflow.get.responses[400]
621:9 error parser Mapping key must be a string scalar rather than number paths./FinancialStatements/Cashflow.get.responses[503]
660:9 error parser Mapping key must be a string scalar rather than number paths./FinancialStatements/ProfitAndLoss.get.responses[200]
712:9 error parser Mapping key must be a string scalar rather than number paths./FinancialStatements/ProfitAndLoss.get.responses[400]
π Validating xero_bankfeeds.yaml...
β
xero_bankfeeds.yaml - PASSED
π Validating xero-payroll-au.yaml...
β
xero-payroll-au.yaml - PASSED
================================================
π SUMMARY:
Total files: 11
Passed: 10
Failed: 1
β οΈ Some files failed validation. Check the output above for details.
Metadata
Metadata
Assignees
Labels
No labels