Skip to content

Release 1.3.0

Choose a tag to compare

@winrid winrid released this 14 Jan 05:15
· 8 commits to main since this release
23bf78a
  • Add response content-type detection and handling: introduce a ContentType enum and inspect the response content-type header in API clients to choose parsing behavior (JSON, text/plain, or unsupported) and return clearer errors when a non-JSON content type cannot be converted to the expected model.
  • Update many API methods (default_api and public_api) to branch parsing based on ContentType (ContentType::Json, ContentType::Text, ContentType::Unsupported) and produce descriptive error messages for text/plain or unknown content types.
  • Add ContentType enum implementation to client::apis::mod and import it where needed in API modules.
  • Implement streaming file uploads in public_api::upload_image using tokio::fs::File and tokio_util::codec::FramedRead/BytesCodec; send multipart file parts from a Tokio file stream so large files are streamed rather than loaded fully into memory.
  • Update HTTP client features/dependencies: enable reqwest stream feature; enable tokio fs feature; add tokio-util dependency (Cargo.toml) and update Cargo.lock (tokio-util, futures-io, futures-macro, wasm-streams, and other resolved deps).
  • Replace the old VoteResponseStatus model with a new Status enum in the VoteResponse model (add Status enum with variants success, failed, pending-verification and a Default impl) and remove the vote_response_status module; update models mod.rs and vote_response.rs accordingly.
  • Adjust code imports: add serde::de::Error as _ where necessary and include ContentType in API modules' use lists.
  • Update public_api implementation to use multipart streaming for file uploads (construct multipart::Part from a wrapped stream and attach file name when available).
  • Remove vote_response_status from the generated file list and delete its docs entry and model file references.
  • Various generated client documentation and model doc fixes: rename and normalize model doc filenames and references (e.g., use CamelCase file names like AggregationRequestSort.md / AggregationRequestSort, QuestionConfigCustomOptionsInner -> QuestionConfigCustomOptionsInner.md links), update inline type representations (replace linked markdown references for serde_json::Value and std::collections::HashMap with direct inline type formatting), and correct/refine many field types in docs to refer to specific enum types (e.g., VoteDir, Dir, Operator, CrudType, From, PermanentFlag, Type, Actions, Note, Code, SortDirections, SizePreset) where applicable.
  • Update numerous docs to fix link targets and type names (examples: FComment_meta -> FCommentMeta references in docs, Record_string... -> RecordString... filenames, various API and model markdown references corrected).
  • Miscellaneous: small code cleanups and consistent error handling for response parsing across many endpoints; update client/.openapi-generator/FILES to reflect removed/renamed files.