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

Consolidate AdditionalProperties with raw data field (Phase 1) #4510

Merged

Conversation

ArcturusZhang
Copy link
Member

@ArcturusZhang ArcturusZhang commented Apr 1, 2024

Fixes #4128

For phases, please refer #4465

Description

  1. Support the ...Record<T> syntax for additional properties.
  2. Update the serialization code so that now when we have additional properties of primitive types, when invalid value comes in, we no longer throw exceptions.

Main changes in the generator:

  1. some changes in the emitter to support ...Record<T> syntax for additional properties. I think we do not have to have a perfect solution for that because the perfect solution for this is adopting getAllModels from TCGC, therefore that change is just making it work.
  2. I changed the JSON serialization to contain two things: an AdditionalPropertiesSerialization and a RawDataFieldSerialization since a model might have both when its additionalProperties property cannot catch everything up.

Checklist

To ensure a quick review and merge, please ensure:

  • The PR has a understandable title and description explaining the why and what.
  • The PR is opened in draft if not ready for review yet.
    • If opened in draft, please allocate sufficient time (24 hours) after moving out of draft for review
  • The branch is recent enough to not have merge conflicts upon creation.

Ready to Land?

  • Build is completely green
    • Submissions with test failures require tracking issue and approval of a CODEOWNER
  • At least one +1 review by a CODEOWNER
  • All -1 reviews are confirmed resolved by the reviewer
    • Override/Marking reviews stale must be discussed with CODEOWNERS first

@ArcturusZhang ArcturusZhang force-pushed the phase1-of-additionalproperties branch from 56c334f to 2ffbdaf Compare April 1, 2024 10:25
@ArcturusZhang ArcturusZhang force-pushed the phase1-of-additionalproperties branch from 2ffbdaf to 03dc014 Compare April 1, 2024 10:28
@ArcturusZhang ArcturusZhang force-pushed the phase1-of-additionalproperties branch from 78c93af to 4d673cb Compare April 2, 2024 01:51
@ArcturusZhang

This comment was marked as outdated.

@ArcturusZhang ArcturusZhang merged commit abb0a20 into Azure:feature/v3 May 10, 2024
8 checks passed
@ArcturusZhang ArcturusZhang deleted the phase1-of-additionalproperties branch May 10, 2024 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants