Safe modification to imprint API for preserved targets support#1108
Safe modification to imprint API for preserved targets support#1108
Conversation
| "target_ids": { | ||
| "nullable": true, | ||
| "description": "Geometry to imprint from, if provided, these bodies will be unmodified and body_ids will be used as imprint targets", | ||
| "default": null, | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string", | ||
| "format": "uuid" | ||
| } | ||
| }, |
There was a problem hiding this comment.
Semantic contradiction in API design: The field is named target_ids but the description states "Geometry to imprint from" and "body_ids will be used as imprint targets". This means target_ids are actually the tools/sources (geometry to imprint from), not the targets.
Furthermore, the description states these bodies "will be unmodified" (unconditionally), but there's also a keep_tools boolean parameter. If target_ids represents the tools and they're always unmodified per this description, then keep_tools becomes ambiguous or contradictory.
This will cause API consumer confusion and potential misuse:
- Users may pass targets in
target_idswhen they should pass tools - The interaction between
keep_toolsand the "will be unmodified" guarantee is unclear
Recommendation:
Option 1: Rename field to clarify
"tool_ids": "Geometry to imprint from (tools). When provided, body_ids become the imprint targets."
Option 2: Clarify the keep_tools interaction
Add: "The keep_tools parameter controls whether these tool bodies are preserved."
| "target_ids": { | |
| "nullable": true, | |
| "description": "Geometry to imprint from, if provided, these bodies will be unmodified and body_ids will be used as imprint targets", | |
| "default": null, | |
| "type": "array", | |
| "items": { | |
| "type": "string", | |
| "format": "uuid" | |
| } | |
| }, | |
| "target_ids": { | |
| "nullable": true, | |
| "description": "Geometry to imprint from (tools). When provided, these bodies act as imprint tools and body_ids become the imprint targets. The keep_tools parameter controls whether these tool bodies are preserved.", | |
| "default": null, | |
| "type": "array", | |
| "items": { | |
| "type": "string", | |
| "format": "uuid" | |
| } | |
| }, | |
Spotted by Graphite
Is this helpful? React 👍 or 👎 to let us know.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1108 +/- ##
=======================================
Coverage ? 30.03%
=======================================
Files ? 34
Lines ? 1588
Branches ? 0
=======================================
Hits ? 477
Misses ? 1111
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
for https://github.com/KittyCAD/engine/pull/4230