-
Notifications
You must be signed in to change notification settings - Fork 213
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
Feat std::collections::LinkedList as a known field type for schema #748
Feat std::collections::LinkedList as a known field type for schema #748
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, just add one test case to schema_derive_test.rs
file that tests this LinkedList
. There are plenty of test's using Vec
so they can work as an example.
@juhaku, here it is. Take a look. Also, a bit off-topic, while I was running The solution might be to always derive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great 👍
Yeah, there is the |
}, | ||
"values": { | ||
"items": { | ||
"type": "string" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this type be: number
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it should 😄 Check the test failure report, also there are other expectation errors as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right. My apologies. Also, I've added the "format": "double"
as it's double-precision floating point value.
I've run the tests using ./scripts/test.sh utoipa-gen
and it seems like everything is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great
One might find
std::collections::LinkedList
more preferable thanVec
, when defining the return type of an API responder. Hence, it would be great to be able to useLinkedList
in schema declaration.This PR registeres
LinkedList
as anotherGenericType
and makes aforesaid possible.I am open to any comments and suggestions.