Closed ahmetoz closed 2 years ago
We had to create this BaseAddress class in order to be able to differentiate between Address and AddressDraft in a backwards compatible way.
The fix here is to not use BaseAddressBuilder but the AddressDraftBuilder. Sorry for the confusion.
Oh yes, I got it now!
I think you could consider this issue as a feedback to add some javadoc for BaseAddress and it's purpose.
Yeah adding some javadoc to generated classes is somehow, let's say complicated 😃
Hmm, I have a wrong mindset, I was not thinking about those are generated code, valid point 😄 👍🏽
The baseAddress as type does not seem consistent with the API. Please check if I'm wrong or not: https://docs.commercetools.com/api/releases/2021-01-29-custom-fields-for-addresses
I would expect to have 2 types as like documented on the API docs: Address and AddressDraft, also considering mapping between those each other should be easy as both almost same except custom field type.
For instance I can not map/build a valid address type.
CustomerDraftBuilder.of() .addresses(BaseAddressBuilder.of().custom(?)); // not a method