diff --git a/docs/automation/API-SPEC.md b/docs/automation/API-SPEC.md index c124f6b31..eb8a18091 100644 --- a/docs/automation/API-SPEC.md +++ b/docs/automation/API-SPEC.md @@ -251,17 +251,18 @@ REST: `POST /documents` (`{}` → fresh document, `{"template":…}`, `{"path": `{"entities":[{…},…]}` — a batch of typed definitions, validated in full before anything commits; one undo step; missing layers are auto-created and reported in `result.layers_created`. Every definition also accepts `layer` -and `color` (index). +and `color` (index); any other field is refused (`unknown_entity_field`). | Type | Fields | |---|---| | `Line` | `start`, `end`, optional `thickness` | | `Circle` | `center`, `radius` (≥ 0) | | `Arc` | `center`, `radius` (> 0), `start_angle_deg`, `end_angle_deg` | +| `Spline` | `control_points` (more than `degree`) or `fit_points` (≥ 2), optional `degree` (1–10, default 3), `knots` (control points + degree + 1, non-decreasing), `weights` (one positive value per control point), `closed`, `periodic`, `rational`, `planar`, `linear` | | `LwPolyline` | `vertices` (≥ 2), `closed`, optional `constant_width` | | `Point` | `location` | | `Text` | `value`, `position`, optional `height` (default 2.5), `rotation_deg`, `style` | -| `MText` | `value`, `position`, optional `height`, `width`, `rotation_deg` | +| `MText` | `value`, `position`, optional `height`, `width`, `rotation_deg`, `style` | | `Insert` | `block` (must exist), `position`, optional `scale` (number or `[x,y,z]`, nonzero), `rotation_deg` | | `Solid` | `corners` (3 or 4 `[x,y,z]`) | | `Hatch` | `boundary` (≥ 3 points, closed), `solid`, or `pattern` (catalog name, default `ANSI31`), `pattern_scale`, `pattern_angle_deg` | diff --git a/docs/automation/README.md b/docs/automation/README.md index c76d22b5d..f86d921a5 100644 --- a/docs/automation/README.md +++ b/docs/automation/README.md @@ -634,10 +634,11 @@ undo step; missing `layer`s are created and reported in `layers_created`. | `Line` | `start`, `end`, optional `thickness` | | `Circle` | `center`, `radius` (≥ 0) | | `Arc` | `center`, `radius` (> 0), `start_angle_deg`, `end_angle_deg` | +| `Spline` | `control_points` (more than `degree`) or `fit_points` (≥ 2), optional `degree` (1–10, default 3), `knots` (control points + degree + 1, non-decreasing), `weights` (one positive value per control point), `closed`, `periodic`, `rational`, `planar`, `linear` | | `LwPolyline` | `vertices` (≥ 2), `closed`, optional `constant_width` | | `Point` | `location` | | `Text` | `value`, `position`, optional `height` (default 2.5), `rotation_deg`, `style` | -| `MText` | `value`, `position`, optional `height`, `width`, `rotation_deg` | +| `MText` | `value`, `position`, optional `height`, `width`, `rotation_deg`, `style` | | `Insert` | `block` (must exist), `position`, optional `scale` (number or `[x,y,z]`, nonzero), `rotation_deg` | | `Solid` | `corners` (3 or 4 `[x,y,z]`) | | `Hatch` | `boundary` (≥ 3 points, closed), `solid`, or `pattern` (catalog name, default `ANSI31`), `pattern_scale`, `pattern_angle_deg` | diff --git a/src/app/control/entities.rs b/src/app/control/entities.rs index 1f766eefe..514b7c60f 100644 --- a/src/app/control/entities.rs +++ b/src/app/control/entities.rs @@ -108,8 +108,6 @@ fn validate_entity_fields(spec: &Value, kind: &str) -> Parsed<()> { field.as_str(), "type" | "center" | "radius" | "start_angle_deg" | "end_angle_deg" | "layer" | "color" ), - // Kept here so the schema remains forward-compatible with the - // Spline entity API when that builder lands separately. "SPLINE" => matches!( field.as_str(), "type" | "degree" | "knots" | "control_points" | "fit_points" | "weights"