vovk 3.0.0-draft.394 → 3.0.0-draft.395
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -102,7 +102,7 @@ function generatePythonCode({ handlerName, rpcName, packageName, queryValidation
|
|
|
102
102
|
});
|
|
103
103
|
const handlerNameSnake = toSnakeCase(handlerName);
|
|
104
104
|
const getFileTouple = (schema) => {
|
|
105
|
-
return `('name.ext', BytesIO(${isTextFormat(schema.contentMediaType) ? '"text_content".encode("utf-8")' : 'binary_data'}${schema.contentMediaType ? `, "${schema.contentMediaType}"` : ''})
|
|
105
|
+
return `('name.ext', BytesIO(${isTextFormat(schema.contentMediaType) ? '"text_content".encode("utf-8")' : 'binary_data'})${schema.contentMediaType ? `, "${schema.contentMediaType}"` : ''})`;
|
|
106
106
|
};
|
|
107
107
|
const getPyFiles = (schema) => {
|
|
108
108
|
return Object.entries(schema.properties ?? {}).reduce((acc, [key, prop]) => {
|
|
@@ -123,7 +123,7 @@ function generatePythonCode({ handlerName, rpcName, packageName, queryValidation
|
|
|
123
123
|
? `${getIndentSpaces(4)}files=[\n${pyFiles.join(',\n')}\n${getIndentSpaces(4)}],`
|
|
124
124
|
: null;
|
|
125
125
|
const PY_CODE = `from ${packageName} import ${rpcName}
|
|
126
|
-
|
|
126
|
+
${bodyValidation?.['x-isForm'] ? 'from io import BytesIO\n' : ''}
|
|
127
127
|
response = ${rpcName}.${handlerNameSnake}(${hasArg
|
|
128
128
|
? '\n' +
|
|
129
129
|
[
|
|
@@ -102,7 +102,7 @@ function generatePythonCode({ handlerName, rpcName, packageName, queryValidation
|
|
|
102
102
|
});
|
|
103
103
|
const handlerNameSnake = toSnakeCase(handlerName);
|
|
104
104
|
const getFileTouple = (schema) => {
|
|
105
|
-
return `('name.ext', BytesIO(${isTextFormat(schema.contentMediaType) ? '"text_content".encode("utf-8")' : 'binary_data'}${schema.contentMediaType ? `, "${schema.contentMediaType}"` : ''})
|
|
105
|
+
return `('name.ext', BytesIO(${isTextFormat(schema.contentMediaType) ? '"text_content".encode("utf-8")' : 'binary_data'})${schema.contentMediaType ? `, "${schema.contentMediaType}"` : ''})`;
|
|
106
106
|
};
|
|
107
107
|
const getPyFiles = (schema) => {
|
|
108
108
|
return Object.entries(schema.properties ?? {}).reduce((acc, [key, prop]) => {
|
|
@@ -123,7 +123,7 @@ function generatePythonCode({ handlerName, rpcName, packageName, queryValidation
|
|
|
123
123
|
? `${getIndentSpaces(4)}files=[\n${pyFiles.join(',\n')}\n${getIndentSpaces(4)}],`
|
|
124
124
|
: null;
|
|
125
125
|
const PY_CODE = `from ${packageName} import ${rpcName}
|
|
126
|
-
|
|
126
|
+
${bodyValidation?.['x-isForm'] ? 'from io import BytesIO\n' : ''}
|
|
127
127
|
response = ${rpcName}.${handlerNameSnake}(${hasArg
|
|
128
128
|
? '\n' +
|
|
129
129
|
[
|