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

Support using an integer as the class/case discriminator in polymorphic serialization #2587

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from

Commits on Feb 17, 2024

  1. Initially add the annotations and refactor the serializers, descripto…

    …rs, and serializers modules for serializing type numbers in polymorphic serialization without any support from the serialization plugin yet
    ShreckYe committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    4ed38d7 View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2024

  1. Configuration menu
    Copy the full SHA
    d8e06b2 View commit details
    Browse the repository at this point in the history
  2. Remove unused code related to storing the map from polymorphic subcla…

    …sses to polymorphic numbers
    
    See commit 3289fb2.
    ShreckYe committed Feb 18, 2024
    Configuration menu
    Copy the full SHA
    f80d7a8 View commit details
    Browse the repository at this point in the history

Commits on Feb 20, 2024

  1. Locate and fix a bug caused by lazy evaluation brought early in `Seal…

    …edSerializer` that causes the tests to break
    ShreckYe committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    5834dcd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5c24ef0 View commit details
    Browse the repository at this point in the history

Commits on Feb 24, 2024

  1. Add some tests for serial polymorphic numbers which fail for now

    Some miscellaneous changes:
    1. Add a `getSerialPolymorphicNumberByBaseClass` function in `SerialDescriptor` to throw the appropriate exception.
    1. Add `defaultDeserializerForNumber` which was missing in `PolymorphicModuleBuilder`.
    ShreckYe committed Feb 24, 2024
    Configuration menu
    Copy the full SHA
    51d9a75 View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2024

  1. Enable Kotlin compiler bootstrap, use the corresponding SNAPSHOT vers…

    …ion, and update an annotation property name
    
    The corresponding commit: huanshankeji/kotlin@9860724
    ShreckYe committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    e101ae8 View commit details
    Browse the repository at this point in the history

Commits on Feb 28, 2024

  1. Move useSerialPolymorphicNumbers and `serialPolymorphicNumberByBase…

    …Class` into `PluginGeneratedSerialDescriptor` where it belongs and add some more tests in `SerialPolymorphicNumberTest` (which fail for now)
    ShreckYe committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    1aa1354 View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2024

  1. Mark the annotations UseSerialPolymorphicNumbers and `SerialPolymor…

    …phicNumber` with `@SerialInfo` to be stored in `SerialDescriptor.annotations` and refactor related code
    
    Main changes:
    1. Extract common lazy properties in `CommonSerialDescriptor` and make both `PluginGeneratedSerialDescriptor` and `SerialDescriptorImpl` inherit it.
    1. Support serial polymorphic numbers with JSON's custom implementations in `AbstractJsonTreeEncoder`, `StreamingJsonEncoder`, and `DynamicObjectEncoder` while adapting the `encodePolymorphically` and `decodeSerializableValuePolymorphic` functions.
    1. Revert gradle.properties since there is no need to update the compiler plugin anymore.
    1. Make all tests pass in `SerialPolymorphicNumberTest` and copy it into the Protobuf module and adapt.
    ShreckYe committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    bcae134 View commit details
    Browse the repository at this point in the history
  2. Run :apiDump and review

    ShreckYe committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    c53d324 View commit details
    Browse the repository at this point in the history
  3. Review all changes since commit 41c0bb1, improving some code and comm…

    …ents and reverting some unnecessary changes
    ShreckYe committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    4973f07 View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2024

  1. Configuration menu
    Copy the full SHA
    23c385c View commit details
    Browse the repository at this point in the history