Comments (14)
@jessfraz, I think there might be an issue with the sdk for the mass and volume, either that or I'm not using it correctly.
I added get_volume.py
and get_mass.py
and functions for the new endpoints return very similar errors.
Error(error_code=<kittycad.types.Unset object at 0x7f4791aa6d90>, message='unable to parse query string: missing field `src_format`', request_id='96a9e6f1-bb24-4be0-827d-176251cde478', additional_properties={})
and
Error(error_code=<kittycad.types.Unset object at 0x7fe68ec4beb0>, message='unable to parse query string: missing field `src_format`', request_id='073782d6-4c1e-42c8-95e5-03eb6181ae77', additional_properties={})
respectively.
Might the SDK not be adding the query param?
see #32.
from litterbox.
Edit: looks like it's putting the format into the path not the query?
https://github.com/KittyCAD/kittycad.py/blob/main/kittycad/api/file/create_file_volume.py#L17
from litterbox.
oh it very well could be! i can try and fix tomorrow
from litterbox.
its likely somewhere around here: https://github.com/KittyCAD/kittycad.py/blob/main/generate/generate.py#L234
if you get to it before me
from litterbox.
I fixed the go one
from litterbox.
Ah thanks!
I've started looking at the python one, and I think I was wrong with my original guess about it being put into the path. Not sure where the problem is.
from litterbox.
oh thats it tho! It needs a check for if its in the query or the path, essentially its trying to add it to the path but failing since there are no more vars!
from litterbox.
this is a dumb diff i have so far but its not adding the query yet:
+ in_query = []
if 'parameters' in endpoint:
parameters = endpoint['parameters']
for parameter in parameters:
@@ -246,12 +247,16 @@ response: Response[""" + success_type + """] = await """ + fn_name + """.asyncio
else:
print(" parameter: ", parameter)
raise Exception("Unknown parameter type")
- f.write(
- ", " +
- parameter_name +
- "=" +
- camel_to_snake(parameter_name))
+ if parameter['in'] == 'path'
+ f.write(
+ ", " +
+ parameter_name +
+ "=" +
+ camel_to_snake(parameter_name))
+ elif parameter['in'] == 'query'
+ in_query.push(parameter)
f.write(")\n")
+ # Now we add the parameters to the query if there are any.
f.write("\n")
f.write("\theaders: Dict[str, Any] = client.get_headers()\n")
maybe that helps
also the makefile has some nice commands like make generate and make shell to pop you into a container w all the deps
from litterbox.
Ah okay
Thanks for the makefile tip, mostly trying to grok the repo at this point.
This is mostly likely useful context for when I get around to making the JS SDK.
from litterbox.
from litterbox.
Hot tip: don't create a virtual python environment in the python SDK repo and expect make generate
to still work 🤦
and yeah for sure, is this how code gen is normally done? tbh I was expecting AST related code, but I haven't every written openAPI code-gen, only used existing ones.
from litterbox.
okay i released the new python version, thank you!
Yeah you can use an AST personally I just don't like them so I do a massive printf def not claiming its better but easier to work my head around haha
from litterbox.
im sure the AST people are like WTF lol
from litterbox.
Thank you!
And yeah fair enough. From memory the names for everything in AST land are not the most intuitive to say the least.
from litterbox.
Related Issues (19)
- fill out samples page HOT 9
- Add formatting bots, enforce 80char line wrapping HOT 1
- Adding formatting bot for js
- One final test issue hopefully
- Improve go base64
- Organise samples into tutorial folders
- tutorial for volume endpoint for prod launch
- Release of interactive tutorial tool HOT 2
- Trigger executor workflow when this repo updates
- Create js sdk HOT 1
- add sample for center of mass endpoint HOT 1
- create sample for surface area endpoint HOT 3
- Add samples directory
- add tags to existing samples HOT 7
- Add seesaw obj for center of mass sample HOT 1
- `output` on file conversions is deprecated HOT 8
- docs.zoo.dev/tutorials is 404
- instead of having to manually add new tutorials to the test github action, we should just find all the python / go/ etc files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from litterbox.