Skip to content

xero-finance.yaml is using incorrect data type for http response code (number vs string)Β #741

@rpocklin

Description

@rpocklin

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions