swagger-axios-codegen
swagger-axios-codegen copied to clipboard
Bugfix/required and nullable difference
Hi there,
We have found a problem concerning nullable fields which lead into more problems, if we are using required, readOnly and nullabel in combination.
To keep the possibility as before, strictRequiredChecks has been added.
- strictRequiredChecks will allow
undefinedvalues - strictNullChecks will allow
nullvalues
We have implemented some changes:
- Extend the field props with the values for
nullableandreadOnly - Changed the behavior of a field description based on these values (for undefined and null seperately)
A field is required when:
- The field property
readOnlyis false and property isrequiredis true orstrictRequiredChecksis false
A field is nullable when:
- The field property
nullableis true orstrictNullChecksis false
These changes might break implementations of other developers, since strictNullCheck has been moved to the nullable evaluation instead required aka undefined.
Minor changes and fixes:
- Removed duplicated service header comments
Please let me know this poses a problem. Happy coding!
You should refer to the code itself to coding style, in prettier semi=false