Skip to content

Conversation

@dbanty
Copy link
Collaborator

@dbanty dbanty commented May 25, 2020

Closes #46.

  1. Simplify the different ways of handling arrays into one ListProperty which can have any other property as its internal type. This required some less-pretty auto-naming of internally declared enums/objects (now suffixing "item") to support arbitrarily nested lists.
  2. Simplify handling of property constructors. If a property has a custom constructor, it now has to be in a template. Can't be just a Python function on the class.
  3. Changed constructor templates to be macros which are called with a property and source argument. property is the actual property being called, source is where the value for that property is coming from. This allows calling property constructors from within other property constructors and eliminates hard coding dict syntax.
  4. Changed constructor templates to start indentation at the top level. Callers will have to handle indenting properly but it allows recursive templates where needed.
  5. Simplify handling of import generation by including a get_imports function on every property. This can handle both relative and absolute imports. Removes the need to check property type before adding imports at higher levels and allows lists to include the imports of their internal properties.

@codecov
Copy link

codecov bot commented May 25, 2020

Codecov Report

Merging #48 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #48   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          597       593    -4     
=========================================
- Hits           597       593    -4     
Impacted Files Coverage Δ
openapi_python_client/openapi_parser/openapi.py 100.00% <100.00%> (ø)
openapi_python_client/openapi_parser/properties.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e74b59...70e6b7d. Read the comment docs.

@dbanty dbanty merged commit 27f3815 into master May 25, 2020
@dbanty dbanty deleted the nested_lists branch May 30, 2020 16:16
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.

Support arbitrarily nested list properties

2 participants