# Streaming record schema definition

**URL:** <http://forum.companieshouse.gov.uk/t/streaming-record-schema-definition/4459>\
**Category:** API Question\
**Created:** [October 14, 2021, 12:45pm UTC](http://forum.companieshouse.gov.uk/t/streaming-record-schema-definition/4459 "2021-10-14T12:45:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dearwicker](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/dearwicker/32/1177_2.png) [@dearwicker](http://forum.companieshouse.gov.uk/u/dearwicker)\
**Post date:** [October 14, 2021, 12:45pm UTC](http://forum.companieshouse.gov.uk/t/streaming-record-schema-definition/4459/1 "2021-10-14T12:45:48Z")

</div>

The schema given here for the company change stream record format:

[https://developer-specs.company-information.service.gov.uk/streaming-api/resources/companyprofilestream?v=latest](https://developer-specs.company-information.service.gov.uk/streaming-api/resources/companyprofilestream?v=latest)

includes a property:

```
"account_period_from:"

```

Is that colon at the end meant to be there? Looks like a typo.

Is there a name for this format for specifying a JSON schema? I can tell it’s not [https://json-schema.org/](https://json-schema.org/) but it seems pretty regular and easy to understand. There are primitive types:

```
"integer"
"date"
"date-time"
"string"
"boolean"

```

If the value of a property is an object, it’s a nested schema. If the value is an array, it will (I guess) always have a single element which is either a primitive or a nested schema. Is this accurate?

---

<div class="post-metadata">

**Author:** ![dearwicker](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/dearwicker/32/1177_2.png) [@dearwicker](http://forum.companieshouse.gov.uk/u/dearwicker)\
**Post date:** [October 15, 2021, 8:53am UTC](http://forum.companieshouse.gov.uk/t/streaming-record-schema-definition/4459/2 "2021-10-15T08:53:53Z")

</div>

At this path in the schema:

```
"data": {
    "accounts": {
        "last_accounts": {
            "type": {}

```

In the first real record I looked at, the “type” property is not an object, but a string. In this case it was `"total-exemption-full"`.

---

<div class="post-metadata">

**Author:** ![dearwicker](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/dearwicker/32/1177_2.png) [@dearwicker](http://forum.companieshouse.gov.uk/u/dearwicker)\
**Post date:** [October 15, 2021, 11:56am UTC](http://forum.companieshouse.gov.uk/t/streaming-record-schema-definition/4459/3 "2021-10-15T11:56:20Z")

</div>

Is there any documentation for the maximum length of the string properties in these change stream records?

---

<div class="post-metadata">

**Author:** ![voracityemail](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/v/b77776/32.png) [@voracityemail](http://forum.companieshouse.gov.uk/u/voracityemail)\
**Post date:** [October 16, 2021, 1:02pm UTC](http://forum.companieshouse.gov.uk/t/streaming-record-schema-definition/4459/4 "2021-10-16T13:02:14Z")

</div>

I’ve no idea for the streaming API specifically. However:  
(a) Companies House have said they didn’t want to commit themselves previously about field lengths (on the main REST API) - see:

> **[Data Returned - Limits](https://forum.aws.chdev.org/t/data-returned-limits/428)**
>
> Hi All, I’m new to this but have successfully integrated the beta companies house search. Is their documentation that advises the max field lengths for the data returned? Thank you. Ian.

…but the gave some “it might be this” indications some time back for some fields:

> **[Maximum field lengths](https://forum.aws.chdev.org/t/maximum-field-lengths/1767)**
>
> Continuing the discussion from Data Returned - Limits: @mfairhurst Please can you post an updated list of maximum field lengths? We have just found someone with a 60-character forename, which is more than the 50-character limit suggested below....

(b) You could make a starting assumption (and verify…) that if the field is one in the main API it will be the same via stream API. Then the main API _may_ have an equivalent / represent the same underlying data as something in the XML gateway. That represents the older technology and that does have some lengths in [their schemas](http://xmlgw.companieshouse.gov.uk/SchemaStatus) (e.g. see [XML the “base types” definitions](http://xmlgw.companieshouse.gov.uk/v1-0/schema/baseTypes-v3-5.xsd)). Check from the main page that you’re looking at the current one as they do update.
