oxidecomputer / oxidecomputer/progenitor
Support for OpenAPI `v3.1.0`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1k
- Forks
- 136
- Avg merge
- 8h 36m
- Merged PRs (30d)
- 14
Description
Hi team at Oxide Computer!
Thanks for such a cool library. I'm using progenitor to create API bindings for an OpenAPI compliant
server builded using utoipa to generate the OpenAPI spec from Rust
source code on build time.
When I attempt to generate API bindings with progenitor I get an error complaining about the OpenAPI
version if it is 3.1.0.
error: generation error for assets/openapi.json: unexpected or unhandled format in the OpenAPI document invalid version: 3.1.0
--> src/client/src/lib.rs:3:15
|
3 | generate_api!("assets/openapi.json");
| ^^^^^^^^^^^^^^^^^^^^^
error: could not compile `ipchat-client` (lib) due to 1 previous error
Here is the OpenAPI spec for reference:
OpenAPI Spec Example
{
"openapi": "3.1.0",
"info": {
"title": "IPChat API",
"description": "API for IPChat application",
"license": { "name": "MIT", "identifier": "MIT" },
"version": "0.0.0"
},
"paths": {
"api/v0/node": {
"get": {
"tags": ["node"],
"operationId": "nodeInfo",
"responses": {
"200": { "description": "Info retrieved successfully" },
"500": { "description": "Internal server error" }
}
}
},
"api/v0/user": {
"get": {
"tags": ["user"],
"operationId": "userRegister",
"responses": {
"201": { "description": "User registered successfully" },
"500": { "description": "Internal server error" }
}
}
}
},
"components": {
"schemas": {
"NodeObject": {
"type": "object",
"required": ["installPath", "clientIp", "localIp", "webSocketAddr"],
"properties": {
"clientIp": {
"type": "string",
"description": "Client's IP Address"
},
"installPath": {
"type": "string",
"description": "Installation path of the node"
},
"localIp": {
"type": "string",
"description": "Node's Local IP Address"
},
"webSocketAddr": {
"type": "string",
"description": "WebSocket Address"
}
}
}
}
},
"tags": [
{ "name": "node", "description": "Node Management" },
{ "name": "user", "description": "User Management" }
]
}
The code is open source so it can be checked out here: https://github.com/LeoBorai/ipchat
Thanks in advance!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the generate_api!("assets/openapi.json") entry point and reproduce the reported failure using the provided OpenAPI 3.1.0 document. Trace where the document version is validated, then verify that generation accepts 3.1.0 and produces compiling API bindings without the invalid-version error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, rust
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100