onshape-public / onshape-clients

All Onshape clients for interacting with the Onshape API.
MIT License
34 stars 29 forks source link

part_studios_api.get_body_details2 raises exception python #15

Closed nasserarbabi closed 4 years ago

nasserarbabi commented 4 years ago

a call to part_studios_api.get_body_details2 raises the exception:

Invalid value for type (plane), must be one of ['PLANE', 'CYLINDER', 'CONE', 'SPHERE', 'TORUS', 'SPUN', 'SWEEP', 'OFFSET', 'BLEND', 'BSURFACE', 'OTHER', 'UNKNOWN']

this is because the returned type from API is in lower case (plane for my case) Three files need modification to lower case:

/onshape_client/oas/models/bt_surface_description.py line 69: allowed_values = ["plane", "cylinder", "cone", "sphere", "torus", "spun", "sweep", "offset", "blend", "bsurface", "other", "unknown"] # noqa: E501

/onshape_client/oas/models/bt_export_model_body.py line 152: allowed_values = ["solid", "surface", "unknown"] # noqa: E501

/onshape_client/oas/models/bt_curve_description.py line 69: allowed_values = ["other", "line", "circle", "ellipse", "bccurve", "icurve", "unkown"] # noqa: E501

hope this is helpful

eak24 commented 4 years ago

I don't believe this happens anymore with the newer version of the client. Thanks for finding and reporting this!