Skip to content

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