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

fix: Price which is set to 0 for CartItem / AdditionalCost are now sent correctly and not ignored #19

Merged
merged 3 commits into from
Nov 8, 2021

Conversation

altJake
Copy link
Member

@altJake altJake commented Nov 8, 2021

Problem

Open API Generator sets DataMember attribute's EmitDefaultValue per default to false.

Unfortunately for some of our data models, it means that the emitted JSON for decimal values of 0 are ignored.

Solution

There's no nice way to address the problem gracefully using a configuration value for the Open API Generator, so currently we manually override the setting for those models.

Currently supported:

  • CartItem's Price property
  • AdditionalCost's Price property

@altJake altJake added the bug label Nov 8, 2021
@altJake altJake self-assigned this Nov 8, 2021
@altJake altJake merged commit 112ade2 into master Nov 8, 2021
@altJake altJake deleted the hotfix/cartitem-zero-price branch November 8, 2021 09:58
altJake added a commit that referenced this pull request Mar 27, 2022
### Problem
Open API Generator sets `DataMember` attribute's `EmitDefaultValue` per default to `false`.

Unfortunately for some of our data models, it means that the emitted JSON for decimal values of `0` are ignored.

### Solution

Manually override the setting for those fields in these models.

Currently supported:
 - `src/TalonOne/Model/CartItem.cs`'s `Position` property
 - `src/TalonOne/Model/ReturnedCartItem.cs`'s `Position` property
 - `src/TalonOne/Model/SetDiscountPerItemEffectProps.cs`'s `Position` property
 
### Notes
 - This is a similar problem to the one fixed in #19 , with a couple of new Models
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant