Forum Discussion

username12357's avatar
New Member
4 years ago

Yaml working on editor but converted json has warnings on codegen build and fails to run

Good afternoon, 
I have written the yaml file for my project in the editor and converted it to json to have it generated using the swagger codegen tool. The steps I took worked for a previous iteration to this project but after adding ~1000 lines to the file something seems to have gone wrong. Below are the steps I took and the output I recieved.

Generating the code started with this command


java -jar swagger-codegen-cli-3.0.23.jar generate -i /home/swagger_projects/openapi.json -l python-flask -o FlaskConnexion-python2 -D supportPython2=true


 which spits out a bunch of this warning


15:59:37.278 [Thread-0] WARN  i.s.c.v.g.DefaultCodegenConfig - String to be sanitized is null. Default to Object


It finishes generating and then when I install the requirements and go to run the server I end up with the following error", line 5, in <module>
    from swagger_server import encoder
  File "swagger_server/", line 4, in <module>
    from swagger_server.models.base_model_ import Model
  File "swagger_server/models/", line 10, in <module>
    from swagger_server.models.body import Body
  File "swagger_server/models/", line 9, in <module>
    from import Data  # noqa: F401,E501
  File "swagger_server/models/", line 9, in <module>
    from swagger_server.models.object import Object  # noqa: F401,E501
ImportError: No module named object


I assume that this error has something to do with the null strings defaulting to Objects, but I cannot find any more info on what that warning means. If anyone has any Idea on either how to fix the warnings or the error it would be greatly appreciated! I unfortunately cannot share the json as it is for my work project, but if anyone recognizes what type of behavior or patterns would cause these issues it would be extremely useful as well. Thank you! 

No RepliesBe the first to reply