Add interface ts_bspline_from_json.
@@ -1042,6 +1042,35 @@ tsError ts_bspline_to_beziers(const tsBSpline *spline, tsBSpline *_beziers_);
*/
tsError ts_bspline_to_json(const tsBSpline *spline, char **_json_);
+/**
+ * Parses \p json and stores the result in \p \_spline\_.
+ *
+ * @param json
+ * The JSON string to parse.
+ * @param _spline_
+ * The output parameter.
+ * @return TS_SUCCESS
+ * On success.
+ * @return TS_PARSE_ERROR
+ * If an error occurred while parsing \p json.
+ * @return TS_DIM_ZERO
+ * If the dimension is 0.
+ * @return TS_LCTRLP_DIM_MISMATCH
+ * If the length of the control point vector modulo dimension is not 0.
+ * @return TS_DEG_GE_NCTRLP
+ * If the degree is greater or equals to the number of control points.
+ * @return TS_NUM_KNOTS
+ * If the number of knots stored in \p json does not match to the number
+ * of control points and the degree of the spline.
+ * @return TS_KNOTS_DECR
+ * If the knot vector is decreasing.
+ * @return TS_MULTIPLICITY
+ * If there is a knot with multiplicity greater than order.
+ * @return TS_MALLOC
+ * If allocating memory failed.
+ */
+tsError ts_bspline_from_json(const char *json, tsBSpline *_spline_);
+
/**
* Saves \p spline as JSON ASCII file.
*
