Skip to content

Commit

Permalink
update api
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Jan 22, 2025
1 parent b0fb09a commit e385fe3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion kscale/web/gen/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# generated by datamodel-codegen:
# filename: openapi.json
# timestamp: 2025-01-22T04:20:37+00:00
# timestamp: 2025-01-22T22:58:10+00:00

from __future__ import annotations

Expand Down Expand Up @@ -72,10 +72,12 @@ class RobotResponse(BaseModel):

class RobotURDFMetadataInput(BaseModel):
joint_name_to_metadata: Optional[Dict[str, JointMetadataInput]] = Field(None, title="Joint Name To Metadata")
control_frequency: Optional[Union[float, str]] = Field(None, title="Control Frequency")


class RobotURDFMetadataOutput(BaseModel):
joint_name_to_metadata: Optional[Dict[str, JointMetadataOutput]] = Field(None, title="Joint Name To Metadata")
control_frequency: Optional[str] = Field(None, title="Control Frequency")


class RobotUploadURDFRequest(BaseModel):
Expand Down
4 changes: 2 additions & 2 deletions kscale/web/gen/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Install the codegen tool: `pip install datamodel-code-generator`

# for testing against local `www` backend, swap off the production openapi URL
openapi_url="http://127.0.0.1:8080/openapi.json"
# openapi_url="https://api.kscale.dev/openapi.json"
# openapi_url="http://127.0.0.1:8080/openapi.json"
openapi_url="https://api.kscale.dev/openapi.json"

curl -s $openapi_url > openapi.json
datamodel-codegen --input openapi.json --input-file-type openapi --output api.py
Expand Down

0 comments on commit e385fe3

Please sign in to comment.