DealsProductResolveResult deals.product-resolve-result@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- deals
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/deals/product-resolve-result.v1.json
deals.product-resolve-result@1: the answer of POST /api/v1/products/resolve on OpenVibe.Deals: { product, created, conflicts } — 201 when the product was created; conflicts lists aliases that pointed elsewhere. Nothing matching with create false is 404 product.not_found.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
product | object | yes | ||
product.id | string | yes | ||
product.slug | string | yes | ||
product.name | string | yes | ||
product.url | string | yes | ||
created | boolean | yes | ||
conflicts | array | yes |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: created
{
"product": {
"id": "dpr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"slug": "example-4k-capture",
"name": "Example 4K Capture",
"url": "https://openvibe.deals/p/example-4k-capture"
},
"created": true,
"conflicts": []
}Rejected: no-product
{
"created": true,
"conflicts": []
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('deals.product-resolve-result@1', value); // { valid, errors: [{ path, message }] }