Bug Report Checklist
Description
The new async file stream support for reqwest client breaks the WASM build.
supportAsync=true (default) implies vendorExtensions.useAsyncFileStream=true, it will add tokio as a dependency with features incompatible with WASM
supportAsync=false, it will enable the blocking feature of reqwest, which does not build for WASM
error: Only features sync,macros,io-util,rt,time are supported on wasm.
--> /home/jmlx/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/lib.rs:475:1
|
475 | compile_error!("Only features sync,macros,io-util,rt,time are supported on wasm.");
|
So IMHO, essentially, the WASM build is essentially 100% broken on 7.15.0.
openapi-generator version
7.15.0
OpenAPI declaration file content or url
swagger: "2.0"
info:
title: File Streaming Test API
version: 1.0.0
paths:
/upload:
post:
consumes:
- application/octet-stream
description: Upload a file from the local filesystem
operationId: uploadFile
parameters:
- description: A test file
in: body
name: inputStream
schema:
format: binary
type: string
responses:
'200':
description: Success
Generation Details
java ${JAVA_OPTS} -jar ${CODEGEN} generate -i \"${INPUT_FILE}\" \
-g ${lang} \
-o ${TMP_PATH} \
--additional-properties=packageName=gltf_live_client_sdk \
--additional-properties=publishRustRegistry=false \
--additional-properties=library=reqwest \
--additional-properties=avoidBoxedModels=true
Steps to reproduce
- Generate the Rust client code
- Attempt to build for
wasm32-unknown-unknown
Related issues/PRs
#21771
Suggest a fix
useAsyncFileStream should be a Cargo feature
Bug Report Checklist
Description
The new async file stream support for reqwest client breaks the WASM build.
supportAsync=true(default) impliesvendorExtensions.useAsyncFileStream=true, it will addtokioas a dependency with features incompatible with WASMsupportAsync=false, it will enable theblockingfeature ofreqwest, which does not build for WASMSo IMHO, essentially, the WASM build is essentially 100% broken on 7.15.0.
openapi-generator version
7.15.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
wasm32-unknown-unknownRelated issues/PRs
#21771
Suggest a fix
useAsyncFileStreamshould be a Cargo feature