-
-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impl JsonSchema for TempFile/RawStr #103
Comments
The same is true for |
For now I'll use |
My first thought is that it should be possible to implement But after looking into it a little, I can see value in having e.g. this struct: #[derive(FromForm, JsonSchema)]
struct MyStruct {
num: i32,
file: TempFile,
} should produce this schema (following Swagger's guide to file uploads): {
"type": "object",
"properties": {
"num": {
"type": "integer",
"format": "int32"
},
"file": {
"type": "string",
"format": "binary"
}
}
} I assume |
Rocket also allows renaming fields (and setting defaults) in |
This would also be very useful because I can now use generic traits so no manual implementation is needed for every type.
Yes, Best also add this under a Optional dependency, but you where most likely already do that.
Yes I know, this has come up in: GREsau/okapi#43 |
Is there any forward progress on this? I'm running into this issue and debating how to handle it. |
HI, I just ran into this issue too. Does the PR need testing, can we help in any way? |
Implement JsonSchema for: - TempFile - NamedFile - RawStr - RawStrBuf Closes: GREsau#103
Hey! |
Last work was two months ago in PR #187 This one will be closed based on what is written in 187. GitHub may not make that totally clear but thats what I will expect to happen when I read the entry just above your comment :) |
Implement JsonSchema for: - TempFile - NamedFile - RawStr - RawStrBuf Closes: GREsau#103
I'm trying to implement OpenApiFromFormField for
rocket::fs::TempFile
.But it looks like Schemars need to implement
JsonSchema
forTempFile
first.Then I can do
let schema = gen.json_schema::<rocket::fs::TempFile>();
and use the value of it inokapi
.The text was updated successfully, but these errors were encountered: