Skip to content

Commit

Permalink
build(deps-dev): bump @stoplight/spectral-cli from 6.11.1 to 6.13.1 (#…
Browse files Browse the repository at this point in the history
…119)

* build(deps-dev): bump @stoplight/spectral-cli from 6.11.1 to 6.13.1

Bumps [@stoplight/spectral-cli](https://github.com/stoplightio/spectral) from 6.11.1 to 6.13.1.
- [Release notes](https://github.com/stoplightio/spectral/releases)
- [Changelog](https://github.com/stoplightio/spectral/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-cli-6.11.1...@stoplight/spectral-cli-6.13.1)

---
updated-dependencies:
- dependency-name: "@stoplight/spectral-cli"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix(openapi): add migration to fix spectral array-items lint error

```
  301:28  error  array-items  Schemas with "type: array", require a sibling "items" field  paths./users/track.post.requestBody.content.application/json.schema.properties.events
 3256:43  error  array-items  Schemas with "type: array", require a sibling "items" field  paths./messages/schedule/create.post.requestBody.content.application/json.schema.properties.audience.properties.AND
 3396:43  error  array-items  Schemas with "type: array", require a sibling "items" field  paths./campaigns/trigger/schedule/create.post.requestBody.content.application/json.schema.properties.audience.properties.AND
 3534:43  error  array-items  Schemas with "type: array", require a sibling "items" field  paths./canvas/trigger/schedule/create.post.requestBody.content.application/json.schema.properties.audience.properties.AND
 3950:43  error  array-items  Schemas with "type: array", require a sibling "items" field  paths./messages/send.post.requestBody.content.application/json.schema.properties.audience.properties.AND
 4163:43  error  array-items  Schemas with "type: array", require a sibling "items" field  paths./campaigns/trigger/send.post.requestBody.content.application/json.schema.properties.audience.properties.AND
 4312:43  error  array-items  Schemas with "type: array", require a sibling "items" field  paths./canvas/trigger/send.post.requestBody.content.application/json.schema.properties.audience.properties.AND
 6165:49  error  array-items  Schemas with "type: array", require a sibling "items" field  paths./users/merge.post.requestBody.content.application/json.schema.properties.merge_updates
```

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mark <[email protected]>
  • Loading branch information
dependabot[bot] and remarkablemark authored Oct 9, 2024
1 parent ddd23d2 commit 4aa1281
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 118 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import spec from '../spec.json';
import { traverse, writeSpec } from '../../utils';

/**
* Schemas with "type: array", require a sibling "items" field
*
* - properties.audience.properties.AND
* - properties.events
* - properties.merge_updates
*/
traverse(spec, '', null, (value, key, parent) => {
if (value instanceof Object && value.type === 'array' && !value.items) {
value.items = { type: 'object' };
}
});

writeSpec(spec);
33 changes: 25 additions & 8 deletions openapi/spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
"type": "array",
"items": { "type": "object" }
},
"events": { "type": "array" },
"events": { "type": "array", "items": { "type": "object" } },
"purchases": {
"type": "array",
"items": { "type": "object" }
Expand Down Expand Up @@ -3253,7 +3253,9 @@
"segment_id": { "type": "string" },
"audience": {
"type": "object",
"properties": { "AND": { "type": "array" } }
"properties": {
"AND": { "type": "array", "items": { "type": "object" } }
}
},
"campaign_id": { "type": "string" },
"send_id": { "type": "string" },
Expand Down Expand Up @@ -3393,7 +3395,9 @@
},
"audience": {
"type": "object",
"properties": { "AND": { "type": "array" } }
"properties": {
"AND": { "type": "array", "items": { "type": "object" } }
}
},
"broadcast": { "type": "boolean" },
"trigger_properties": { "type": "object" },
Expand Down Expand Up @@ -3531,7 +3535,9 @@
},
"audience": {
"type": "object",
"properties": { "AND": { "type": "array" } }
"properties": {
"AND": { "type": "array", "items": { "type": "object" } }
}
},
"broadcast": { "type": "boolean" },
"canvas_entry_properties": { "type": "object" },
Expand Down Expand Up @@ -3947,7 +3953,9 @@
"segment_id": { "type": "string" },
"audience": {
"type": "object",
"properties": { "AND": { "type": "array" } }
"properties": {
"AND": { "type": "array", "items": { "type": "object" } }
}
},
"campaign_id": { "type": "string" },
"send_id": { "type": "string" },
Expand Down Expand Up @@ -4160,7 +4168,9 @@
"broadcast": { "type": "boolean" },
"audience": {
"type": "object",
"properties": { "AND": { "type": "array" } }
"properties": {
"AND": { "type": "array", "items": { "type": "object" } }
}
},
"recipients": {
"type": "array",
Expand Down Expand Up @@ -4309,7 +4319,9 @@
"broadcast": { "type": "boolean" },
"audience": {
"type": "object",
"properties": { "AND": { "type": "array" } }
"properties": {
"AND": { "type": "array", "items": { "type": "object" } }
}
},
"recipients": {
"type": "array",
Expand Down Expand Up @@ -6162,7 +6174,12 @@
}
]
},
"properties": { "merge_updates": { "type": "array" } }
"properties": {
"merge_updates": {
"type": "array",
"items": { "type": "object" }
}
}
}
}
}
Expand Down
Loading

0 comments on commit 4aa1281

Please sign in to comment.