You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's just an issue with the example. Even if the function is impl IntoApiResponse the response type is automatically derived, but it is also manually added thus the error (which is printed by the on error hook).
What if one wants to specify a custom response type for the 200 status code?
Would they have to change the impl IntoApiResponse with a custom type like Json<TodoList> or something, and not specify response::<200, Json<TodoList>>() for the TransformOperation ?
The custom response is implicitly generated from the response type, so any Json<MyJsonStruct> will be documented as responding MyJsonStruct with code 200 regardless if if the fn returns Json<MyJsonStruct> or impl IntoApiResponse.
Also consider using axum-jsonschema for the Json response as it gives better json parse errors.
Since #88 landed, the
example-axum
project printsthe response for status "200" already exists for the operation
when launching the application.This seems to be due to
list_todos_docs
trying to override thelist_todos
route with a200
response status code, but it already exists.I discovered this in my own project due having a
panic!
instead of aprintln!
insideaide::gen::on_error
.Not sure if it's a bug in
aide
, or the example needs to be modified somehow.The text was updated successfully, but these errors were encountered: