Skip to content

Fixes to union properties#241

Merged
dbanty merged 6 commits intoopenapi-generators:mainfrom
benchling:union-property-fixes
Nov 18, 2020
Merged

Fixes to union properties#241
dbanty merged 6 commits intoopenapi-generators:mainfrom
benchling:union-property-fixes

Conversation

@packyg
Copy link
Contributor

@packyg packyg commented Nov 13, 2020

  • Fix indentation of transforms on inner_propertys of the UnionProperty
    • Was overindented, causing error in generated models
  • Update transform on all templates to take in a declare_type kwarg (default True) that determines if the first declaration of the property should include typedef
    • Used by union_property.pyi's transform to prevent mypy issues when calling the transform of its inner_properties
  • Update construct on all templates to take a initial_value kwarg (defaults as appropriate, usually None, [] for lists)
    • Used by union_property.pyi's construct to prevent invalidly assigning None to the inner_property
  • Update the _parse_<inner_property> function in union_property's construct to use the passed subresource instead of the top level dict from the outer scope

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants