Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

field2property rework #199

Merged
merged 5 commits into from Apr 11, 2018

Conversation

@lafrech
Copy link
Member

commented Apr 9, 2018

This PR reworks field2property a bit to provide more consistency to the field2attribute methods. This makes it easier to manage different OpenAPI versions.

It also adds the x-nullable/nullable and writeOnly attributes depending on the version.

It does not address the optional spec attribute issue discussed in #197 but it is a first step.

@sloria, @Bangertm Feedback welcome.

@lafrech lafrech force-pushed the Nobatek:dev_jl_field2property_rework branch from 7e2af9c to 6169811 Apr 9, 2018

@sloria

sloria approved these changes Apr 10, 2018

Copy link
Member

left a comment

I think this approach is a big improvement. +1 to moving OpenAPI 3 work forward, too. Nice!

return attributes


def field2write_only(field, **kwargs):

This comment has been minimized.

Copy link
@lafrech

lafrech Apr 10, 2018

Author Member

If this was Python 3 only, I'd write

def field2write_only(field, *, openapi_major_version, **kwargs):
@lafrech

This comment has been minimized.

Copy link
Member Author

commented Apr 10, 2018

Great. Shall I merge this, then?

@sloria

This comment has been minimized.

Copy link
Member

commented Apr 11, 2018

LGTM 🚢 🇮🇹

@sloria sloria merged commit bcbee87 into marshmallow-code:dev Apr 11, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.