forked from loafle/openapi-generator-original
[RUST-AXUM] fix generator not handling application/x-www-form-urlencoded request content, update for initial fix #18061 (#18362)
* fix OpenAPITools/openapi-generator#18060 * isolate the option as separate flag * apply modification suggested by @wing328 * remove added newlines * do not change the handle of multipart body, keep the change only for x-www-form-urlencoded
This commit is contained in:
@@ -7,4 +7,6 @@ additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
packageName: petstore-with-fake-endpoints-models-for-testing
|
||||
publishRustRegistry: crates-io
|
||||
enablePostProcessFile: true
|
||||
globalProperties:
|
||||
skipFormModel: false
|
||||
enablePostProcessFile: true
|
||||
|
||||
@@ -6,4 +6,6 @@ generateAliasAsModel: true
|
||||
additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
packageName: petstore
|
||||
globalProperties:
|
||||
skipFormModel: false
|
||||
enablePostProcessFile: true
|
||||
|
||||
@@ -52,6 +52,7 @@ import org.openapitools.codegen.api.TemplatingEngineAdapter;
|
||||
import org.openapitools.codegen.config.GlobalSettings;
|
||||
import org.openapitools.codegen.examples.ExampleGenerator;
|
||||
import org.openapitools.codegen.languages.PhpNextgenClientCodegen;
|
||||
import org.openapitools.codegen.languages.RustAxumServerCodegen;
|
||||
import org.openapitools.codegen.languages.RustServerCodegen;
|
||||
import org.openapitools.codegen.meta.FeatureSet;
|
||||
import org.openapitools.codegen.meta.GeneratorMetadata;
|
||||
@@ -4742,7 +4743,7 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
contentType = contentType.toLowerCase(Locale.ROOT);
|
||||
}
|
||||
if (contentType != null &&
|
||||
(contentType.startsWith("application/x-www-form-urlencoded") ||
|
||||
((!(this instanceof RustAxumServerCodegen) && contentType.startsWith("application/x-www-form-urlencoded")) ||
|
||||
contentType.startsWith("multipart"))) {
|
||||
// process form parameters
|
||||
formParams = fromRequestBodyToFormParameters(requestBody, imports);
|
||||
|
||||
Reference in New Issue
Block a user