Uh oh!
There was an error while loading. Please reload this page.
[Python-experimental] JSON schema 'null' type should be modeled as 'none_type' - #6121
Conversation
sebastien-rosset
commented
Apr 30, 2020
@spacether , I'm not sure if I should handle the OAS |
spacether
commented
Apr 30, 2020
I think that we need to add the type mapping but I have not used that before. For Python-experimental we should point it to our already defined none_type. |
sebastien-rosset
commented
Apr 30, 2020
ok, sure, let me try with typeMappings. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
spacether
left a comment
There was a problem hiding this comment.
Please add a python test showing deserializing a None working correctly.
sebastien-rosset
commented
May 1, 2020
Added unit test |
spacether
left a comment
There was a problem hiding this comment.
These python-experimental updates look good. Thank you for this PR.
@sebastien-rosset we need the CI tests to pass before we can merge this. It might need parens around that statement because it is multiline, like: Can you fix it? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
@sebastien-rosset to fix this next CI-error you need to update this line: or change the oneof_anyof_classes assignment in |
sebastien-rosset
commented
May 8, 2020
I have some something like that here: https://github.com/OpenAPITools/openapi-generator/pull/5809/files#diff-cc72ac40056827e3a103f9b4f56059cfR70 I mentioned #5809 should be merged before this PR. |
It looks like recently something changed because the JSON schema
nulltype is now causing problems. I'm not sure what specific commit caused this problem. ThegetTypeStringfunction in PythonClientExperimentalCodegen.java is incorrectly returningnullwhen the input Schema is the Null type.For example, with the following schema, the generated python-experimental code has syntax errors.
Without this PR, the following import is incorrectly generated:
PR checklist
./bin/(or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run./bin/{LANG}-petstore.sh,./bin/openapi3/{LANG}-petstore.shif updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).master,4.3.x,5.0.x. Default:master.