adwhit / hsr

Fast APIs, fast
MIT License
17 stars 5 forks source link

Lots of todo!() #13

Open jayvdb opened 1 year ago

jayvdb commented 1 year ago

This issue is to help anyone else venturing here to get a feel for some of the openapi functionality which is not yet supported, and cause the codegen to panic. I suspect that there are other openapi/jsonschema features that are silently ignored (e.g. callbacks/examples?), but I havent played around much.

It would be nice to get a feel for which of these are a priority for the immediate future of this project. Possibly which are easiest and help show off the capabilities of hsr.

hsr-codegen/src/walk.rs:        todo!("Security not supported")
hsr-codegen/src/walk.rs:            todo!("Path-level paraters are not supported")
hsr-codegen/src/walk.rs:        todo!("Security not supported")
hsr-codegen/src/walk.rs:                    ParameterSchemaOrContent::Content(_) => todo!(),
hsr-codegen/src/walk.rs:            Header { .. } => todo!(),
hsr-codegen/src/walk.rs:            Cookie { .. } => todo!(),
hsr-codegen/src/walk.rs:        todo!("Can't have more than one content type");
hsr-codegen/src/walk.rs:                todo!("Content other than application/json not supported")
hsr-codegen/src/walk.rs:        todo!("response headers not supported")
hsr-codegen/src/walk.rs:        todo!("response links not supported")
hsr-codegen/src/walk.rs:        todo!("Default values not supported (location: '{}')", path)
hsr-codegen/src/walk.rs:        todo!("Discriminator values not supported (location: '{}')", path)
hsr-codegen/src/walk.rs:                todo!("Additional properties not supported (location: '{}')", path)
hsr-codegen/src/walk.rs:        SchemaKind::Not { .. } => todo!("'not' is not yet supported")
hsr-codegen/src/walk.rs:                todo!("String formats not supported (location: '{}')", path)
hsr-codegen/src/walk.rs:                todo!("String patterns not supported (location: '{}')", path)
hsr-codegen/src/walk.rs:                todo!("Additional properties not supported")
hsr-codegen/src/walk.rs:            _ => todo!("Non-struct allOf combinations are not supported"),

String formats (uuid, date-time) and Default values are the two todo! I needed to comment out to get a fairly simple use case to codegen. I suspect these two are not too hard to solve, and the solutions would look very similar to other Rust openapi codegens.