Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): Correct the type for Field['items'] #313

Merged
merged 1 commit into from
Mar 11, 2019
Merged

fix(types): Correct the type for Field['items'] #313

merged 1 commit into from
Mar 11, 2019

Conversation

stevenpetryk
Copy link
Contributor

The items attribute in a Content Type is not an array, it's an object, and it gives a summary of the types that are IN the array. This PR fixes the type. Example response straight from the API for proof:

{
  "id": "logos",
  "name": "Logos",
  "type": "Array",
  "localized": false,
  "required": true,
  "validations": [{ "size": { "min": 5, "max": 15 } }],
  "disabled": false,
  "omitted": false,
  "items": {
    "type": "Link",
    "validations": [{ "linkContentType": ["logo"] }],
    "linkType": "Entry"
  }
}

The `items` attribute in a Content Type is not an array—it's an object, and it gives a summary of the types that are IN the array. This PR fixes the type. Example response straight from the API for proof:

```json
{
  "id": "logos",
  "name": "Logos",
  "type": "Array",
  "localized": false,
  "required": true,
  "validations": [{ "size": { "min": 5, "max": 15 } }],
  "disabled": false,
  "omitted": false,
  "items": {
    "type": "Link",
    "validations": [{ "linkContentType": ["logo"] }],
    "linkType": "Entry"
  }
}
```
@stevenpetryk stevenpetryk changed the title Correct the type for Field['items'] fix(types): Correct the type for Field['items'] Mar 9, 2019
@Khaledgarbaya Khaledgarbaya merged commit 810cd6e into contentful:master Mar 11, 2019
@phoebeschmidt
Copy link
Contributor

🎉 This PR is included in version 7.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@stevenpetryk stevenpetryk deleted the patch-1 branch March 18, 2019 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants