-
Notifications
You must be signed in to change notification settings - Fork 105
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
[16.0][IMP] shopinvader_schema_address: add field res_partner.company_type on Address Schema #1561
base: 16.0
Are you sure you want to change the base?
[16.0][IMP] shopinvader_schema_address: add field res_partner.company_type on Address Schema #1561
Conversation
@@ -16,6 +16,7 @@ class Address(StrictExtendableBaseModel): | |||
email: str | None = None | |||
state_id: int | None = None | |||
country_id: int | None = None | |||
company_type: str | None = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would have been a good idea to declare the company_type as an enum in order to provide api users with the possible values for this field....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think we should do a little something to document the possible values for company_type
.
@lmignon do you know if Literal["person", "company"] | None
would work with pydantic? Else a str | None = Field(description="...")
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lmignon For sure it works. 'Literal' will be rendered as 'enum' into the openapi doc. {...'company_type': {'enum': ['person', 'company'], ....}
.
/ocabot merge patch |
@lmignon The merge process could not start, because command
|
Let's run the tests first ;) And I'll check what's up with the bot. |
This PR has the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and Literal["person", "company"] | None
would indeed be better.
…on Address Schema
212477f
to
56b764c
Compare
No description provided.