aubergine-developers / nadia

Small and lightweight library for creating marshmallow Schemas for objects defined in OpenAPI 3 specs.
MIT License
1 stars 0 forks source link

Refactor/builder mapping #7

Closed dexter2206 closed 5 years ago

dexter2206 commented 5 years ago

I think I overengineered BuilderProvider and Schema builder. As I see it now they introduced unnecessary abstraction layer, whereas something with mapping interface should be enough to serve factories of builders and a simple function would suffice for building schemas.

This PR reflects the above and replaces BuilderProvider with BuilderMapping and SchemaBuilder with build_schema function. As a bonus, build_schema is exposed in top level nadia package.

codecov-io commented 5 years ago

Codecov Report

Merging #7 into develop will increase coverage by 0.4%. The diff coverage is 86.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop       #7     +/-   ##
==========================================
+ Coverage    93.61%   94.01%   +0.4%     
==========================================
  Files           14       14             
  Lines          235      234      -1     
==========================================
  Hits           220      220             
+ Misses          15       14      -1
Impacted Files Coverage Δ
nadia/__init__.py 100% <100%> (ø)
tests/test_builder_mapping.py 100% <100%> (ø)
nadia/array.py 100% <100%> (ø) :arrow_up:
tests/test_object.py 100% <100%> (ø) :arrow_up:
tests/test_array.py 100% <100%> (ø) :arrow_up:
nadia/object.py 100% <100%> (ø) :arrow_up:
nadia/common.py 90% <100%> (ø) :arrow_up:
nadia/api.py 57.14% <40%> (+3.29%) :arrow_up:
nadia/builder_mapping.py 74.07% <74.07%> (ø)
... and 2 more

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 6165ce9...9e939f2. Read the comment docs.