-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't working
Description
RustAPI Version
Nan
Rust Version
Nan
Operating System
Windows
Description
The path parameter in the route /pins{id} is a UUID (Path<Uuid>), but in the generated openapi.json, the parameter is incorrectly defined as { "format": "int64", "type": "integer" } instead of the correct UUID type. See discussion: #53.
Steps to Reproduce
- Create a handler using
Path<Uuid>:
/// Get a pin by ID
#[rustapi_rs::get("/pins{id}")]
#[rustapi_rs::tag("Pins")]
#[rustapi_rs::summary("Get Pin")]
#[rustapi_rs::description("Read a pin by id.")]
async fn read(
State(state): State<AppState>,
Path(id): Path<Uuid>,
) -> Result<Json<Pin>> {
let pin = Pin::default();
Ok(Json(pin))
}- Check the generated
/docs/openapi.jsonfor the definition of the route parameter. - Observe that
idis defined as aninteger, not a UUID.
Expected Behavior
The parameter id should be defined as a UUID type in the OpenAPI spec (e.g., { "type": "string", "format": "uuid" }).
Actual Behavior
id is defined as { "format": "int64", "type": "integer" } in the OpenAPI spec, which causes clients to treat it as a number, leading to integration errors.
Additional Context
See full details and screenshot in the linked discussion: #53
Checklist
- I have searched for similar issues and couldn't find any.
- I have tried the latest version of RustAPI.
- I have provided all the required information above.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working