You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Allow arrays as custom properties
* Remove unnecessary sentence
* Add custom field example to topic get request
* Use object instead of string for enum values definition
Copy file name to clipboardExpand all lines: README.md
+18-3Lines changed: 18 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -392,14 +392,25 @@ Project extensions are used to define possible values that can be used in topics
392
392
"name": "price_in_dollar",
393
393
"type": "decimal",
394
394
"readonly": false,
395
-
"required": true
395
+
"minArraySize": 1,
396
+
"maxArraySize": 1
396
397
}
397
398
]
398
399
}
399
400
400
401
> **About custom fields:** Projects may be configured to allow `custom_fields` in a topic. This is a way of enabling clients and servers to embed custom data in a topic. Those custom fields can be sent when creating or updating a topic, and they will be returned by the server when retrieving topics.
401
402
402
-
Custom field values are always represented as strings. The type of the custom field indicates how it should be parsed. The value null indicates that it is absent.
403
+
Custom field values are always represented as arrays of strings. The type of the custom field indicates how its values should be parsed. Since all custom fields are expressed as arrays, the `minArraySize` and `maxArraySize` properties are used to describe the required cardinality of the field. For example:
404
+
405
+
|`minArraySize`|`maxArraySize`| Description | Example |
406
+
|-|-|-|-|
407
+
|`1`|`1`| Single required item |`["My Custom Value"]`|
408
+
|`0`|`1`| Single optional item |`[]` or `["My Custom Value"]`|
409
+
|`1`|`null`| Multiple required items |`["My Custom Value"]` or `["My Custom Value", "My Other Value"]`|
410
+
|`0`|`null`| Multiple optional items |`[]` or `["My Custom Value"]` or `["My Custom Value", "My Other Value"]`|
411
+
|`2`|`2`| Two required items |`["My Custom Value", "My Other Value"]`|
412
+
413
+
The following types are supported:
403
414
- integer: A number that does not contain decimals
404
415
- decimal: A number than can contain decimals
405
416
- string: Any string
@@ -568,7 +579,11 @@ JSON encoded body using the "application/json" content type.
0 commit comments