Skip to content

field2property rework #199

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

Merged
merged 5 commits into from
Apr 11, 2018
Merged

field2property rework #199

merged 5 commits into from
Apr 11, 2018

Conversation

lafrech
Copy link
Member

@lafrech lafrech 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.

Copy link
Member

@sloria sloria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

return attributes


def field2write_only(field, **kwargs):
Copy link
Member Author

@lafrech lafrech Apr 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this was Python 3 only, I'd write

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

@lafrech
Copy link
Member Author

lafrech commented Apr 10, 2018

Great. Shall I merge this, then?

@sloria
Copy link
Member

sloria commented Apr 11, 2018

LGTM 🚢 🇮🇹

@sloria sloria merged commit bcbee87 into marshmallow-code:dev Apr 11, 2018
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