Skip to content

Conversation

@saintentropy
Copy link
Contributor

Purpose

This sets the SelectedIndex to nullable so that it does not serialize with every input type. This key / value should only be serialized when the input type is a DropDown.

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated

Reviewers

@mjkkirschner @nate-peters

FYIs

@BogdanZavu

@saintentropy saintentropy changed the title Fix extra serialization of the SelectedIndex Fix unintended serialization of the SelectedIndex for Input nodes Sep 28, 2021
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public int SelectedIndex { get; set; }
public int? SelectedIndex { get; set; }
Copy link
Member

@mjkkirschner mjkkirschner Sep 28, 2021

Choose a reason for hiding this comment

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

it's likely this is an API break.
I don't know if we care - but I think it fits in:

❌ DISALLOWED: Changing the type of a member

The return value of a method or the type of a property or field cannot be modified. For example, the signature of a method that returns an Object cannot be changed to return a String, or vice versa.

this may cause binary compatibility issues with any code that referenced this member, can you check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you are right. That was my reading of it as well. I do think we should probably make the change though. I will double check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mjkkirschner Yep it does fail if you directly read or set the SelectedIndex but I think we should fix this.

Copy link
Member

Choose a reason for hiding this comment

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

Hey - finally time to do this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Marked as 3.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep let's do this. Just updated the branch @mjkkirschner @QilongTang

@QilongTang QilongTang added this to the 3.0 milestone Nov 1, 2023
@saintentropy saintentropy merged commit 8d88929 into DynamoDS:master Nov 14, 2023
@saintentropy saintentropy deleted the AddNullableType branch November 14, 2023 22:08
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.

3 participants