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
kinda, I'm using the Docker version of 2 weeks ago : swaggerapi/swagger-codegen-cli-v3:3.0.54
test locally with the most recent jar
I'll try to do it soon
Using the python-flask generator, I sometimes find myself with invalid __init__.py files, containing four NULL (0x00) bytes. When Python then tries to parse them, it fails (and thus the server does not start).
set -euo pipefail # check for errorsecho'(re-)create output directory'
rm -Rf ./output && mkdir ./output
echo'copy the OpenAPI file into it'
cp ./openapi.yml ./output
echo'generate the server files from the OpenAPI file'
docker run \
--rm \
-u "$(id -u):$(id -g)" \
-v "${PWD}/output:/local" \
swaggerapi/swagger-codegen-cli-v3:3.0.54 \
generate \
-l python-flask \
-i /local/openapi.yml \
-o /local
echo'check the content of one of the generated __init__.py files'
hexdump -C ./output/swagger_server/controllers/__init__.py
It produces :
check the content of one of the generated __init__.py files
00000000 00 00 00 00 |....|
00000004
(if you are not familiar with hexdump, it prints the binary content of a file)
Here we can see that the file contains four 0x00 (NULL) bytes. This is not a valid Python file.
I don't know what causes it.
Expected content : empty (0 bytes), or valid Python content (like in some other generated __init__.py files)
Actual content : four NULL (0x00) bytes.
The text was updated successfully, but these errors were encountered:
I'm not reproducing the issue when running directly the code from the Swagger Codegen v3.0.54 tag (NOT* the most recent, but the one corresponding to the Docker version used in the initial report).
But I'm reproducing when running the running the Docker image :
swaggerapi/swagger-codegen-cli-v3 3.0.54 17244ca249e8 4 months ago 291MB
Hello,
Checklist from your CONTRIBUTING files :
swaggerapi/swagger-codegen-cli-v3:3.0.54
Using the
python-flask
generator, I sometimes find myself with invalid__init__.py
files, containing four NULL (0x00) bytes. When Python then tries to parse them, it fails (and thus the server does not start).Minimal reproducible example :
openapi.yml
generate_server.bash
It produces :
(if you are not familiar with
hexdump
, it prints the binary content of a file)Here we can see that the file contains four 0x00 (NULL) bytes. This is not a valid Python file.
I don't know what causes it.
Expected content : empty (0 bytes), or valid Python content (like in some other generated
__init__.py
files)Actual content : four NULL (0x00) bytes.
The text was updated successfully, but these errors were encountered: