hmrc / vat-api

Apache License 2.0
66 stars 17 forks source link

Inaccurate API documentation #1012

Open ubiuser opened 10 months ago

ubiuser commented 10 months ago

Bug report

Describe the bug The generated documentation does not match the actual returned 403 error for the 'Submit VAT return for period' endpoint. The example in the docs https://developer.service.hmrc.gov.uk/api-documentation/docs/api/service/vat-api/1.0/oas/page#tag/organisations/operation/SubmitVATreturnforperiod is:

{
"code": "NOT_FINALISED",
"message": "User has not declared VAT return as final"
}

Actual response is:

{
    "code": "BUSINESS_ERROR",
    "message": "Business validation error",
    "errors": [
        {
            "code": "NOT_FINALISED",
            "message": "The return cannot be accepted without a declaration it is finalised.",
            "path": "/finalised"
        }
    ]
}

To Reproduce Make a request to 'Submit VAT return for period' endpoint with finalised=false and compare the returned error to the documentation.

Expected behavior Documentation matches implementation.

Additional context Relevant code blocks: