Open mhemmings opened 4 years ago
Correct me if I'm wrong but the JSON schema rejects numbers as strings as numbers. https://json-schema.org/understanding-json-schema/reference/numeric.html So I think the fault is in the example you gave us, it should look like:
{
"accounts" : {
"accounting_reference_date" : {
"day" : 31,
"month" : 12
},
...
}
Yes that's what I'd expect, and that's what the docs say to expect. However the API returns strings
Okay if this is the behavior of the actual API implementation, then this is the wrong repo. The purpose of this is mostly around recieving broken dapperdocs specs and converting them into valid OpenAPI3.
Apologies if this is the incorrect repo; not sure if it's a documentation or implementation issue.
The docs define all
day
andmonth
fields as integers (e.g. https://github.com/companieshouse/specs.developer.ch.gov.uk/blob/351632ccb69e1a13e7bd222caabe48d6d7957f5f/openapi3render/markdown_specs/companyProfile.html.md#schemaaccountinformation).However, the API api.companieshouse.gov.uk returns them as strings.
For example:
GET https://api.companieshouse.gov.uk/company/00000006
returnsFrom my testing, this appears to be true for the day/month fields in
accounts.accounting_reference_date
,foreign_company_details.accounts.account_period_to
,foreign_company_details.accounts.account_period_from
andforeign_company_details.accounts.must_file_within