Skip to content

Commit

Permalink
Not double-escaping metadata partids (see #46)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregwar committed Nov 15, 2022
1 parent 2d0274e commit ce90b62
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions onshape_to_robot/onshape_api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
import hashlib
from pathlib import Path

def double_escape_slash(s):
return s.replace('/', '%252f')

def escape_slash(s):
return s.replace('/', '%2f')

Expand Down Expand Up @@ -341,7 +338,7 @@ def invoke():

def part_get_metadata(self, did, mid, eid, partid, configuration = 'default'):
def invoke():
return self._api.request('get', '/api/parts/d/' + did + '/m/' + mid + '/e/' + eid + '/partid/'+double_escape_slash(partid)+'/metadata', query={'configuration': configuration})
return self._api.request('get', '/api/parts/d/' + did + '/m/' + mid + '/e/' + eid + '/partid/'+escape_slash(partid)+'/metadata', query={'configuration': configuration})

return json.loads(self.cache_get('metadata', (did, mid, eid, self.hash_partid(partid), configuration), invoke, True))

Expand Down

0 comments on commit ce90b62

Please sign in to comment.