Skip to content

fix: remove invalid libraryRelationType: "NONE" from feature builders#19

Open
candera wants to merge 1 commit into
hedless:developfrom
candera:feature/fix-library-relation-type-none
Open

fix: remove invalid libraryRelationType: "NONE" from feature builders#19
candera wants to merge 1 commit into
hedless:developfrom
candera:feature/fix-library-relation-type-none

Conversation

@candera

@candera candera commented Jul 2, 2026

Copy link
Copy Markdown

Summary

Fixes #18. Six feature builders hard-coded "libraryRelationType": "NONE" on every parameter they emit. Onshape's /api/v9/.../features endpoint rejects "NONE" as an invalid enum value (HTTP 400, BTWeirdStringValueException), which broke create_extrude, create_revolve, create_linear_pattern, create_circular_pattern, create_fillet, create_chamfer, and create_boolean against a live document.

Omitting the field lets Onshape default it to "DEFAULT", which is accepted — the sketch builder already omits it and works. Verified end-to-end by building a real extruded part after the change.

Changes

  • Remove "libraryRelationType": "NONE" (27 occurrences) from extrude.py, revolve.py, pattern.py, fillet.py, chamfer.py, boolean.py.
  • Add tests/builders/test_library_relation_type_regression.py asserting no builder emits libraryRelationType == "NONE" (parametrized over all seven builders, including both pattern types).

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD or build changes

Testing

  • Tests pass locally (pytest -v) — 504 passed
  • New tests added for new functionality
  • Coverage threshold maintained (80%+) — 86.02%

Checklist

  • Code follows project style (ruff check passes)
  • Self-reviewed the changes
  • No secrets or credentials included

🤖 Generated with Claude Code

The extrude, revolve, linear/circular pattern, fillet, chamfer, and boolean
builders hard-coded `"libraryRelationType": "NONE"` on every parameter they
emitted. Onshape's /features endpoint (API v9) rejects "NONE" as an invalid
enum value, returning HTTP 400 with a BTWeirdStringValueException. This made
create_extrude, create_revolve, create_linear_pattern, create_circular_pattern,
create_fillet, create_chamfer, and create_boolean all fail against a real
document.

Omitting the field lets Onshape default it to "DEFAULT", which is accepted
(the sketch builder already omits it and works). Add a regression test that
asserts no builder emits libraryRelationType == "NONE".

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@candera
candera requested a review from hedless as a code owner July 2, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature builders send invalid libraryRelationType: "NONE", causing HTTP 400 on /features (API v9)

1 participant