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

feat(generator): flatten model properties #5094

Merged
merged 12 commits into from
Oct 10, 2024

Conversation

archerzz
Copy link
Member

@archerzz archerzz commented Sep 27, 2024

Description

This commit will flatten the model property in generator, instead of in the emitter.

  • Modify InputModelProperty
    • add an IsFlatten property for original emitter input
    • remove FlattenNames property from constructor
  • change model json converter:
    • convert TypeSpecInputModelProperty to InputModelProperty
    • flatten model property if necessary
  • refactor

resolve #4788

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

Mingzhe Huang (from Dev Box) added 2 commits September 27, 2024 16:04
This commit will flatten the model property in generator, instead of in the emitter.

- Modify `InputModelProperty`
  - add an `IsFlatten` property for original emitter input
  - remove `FlattenNames` property from constructor
- change model json converter:
  - convert `TypeSpecInputModelProperty` to `InputModelProperty`
  - flatten model property if necessary
- refactor

resolve Azure#4449
@archerzz
Copy link
Member Author

Regen preview: Azure/azure-sdk-for-net#46340

No code change

Mingzhe Huang (from Dev Box) added 4 commits October 9, 2024 15:43
…a multipart

change flattened property to optional if parent property is optional

Revert "change flattened property to optional if parent property is optional"

This reverts commit 88f936285aec19635ade3a2ba6194a6985a31cdc.
@archerzz archerzz enabled auto-merge (squash) October 10, 2024 03:30
@archerzz archerzz merged commit ca8310c into Azure:main Oct 10, 2024
8 checks passed
@archerzz archerzz deleted the generator/flatten-model-property branch October 10, 2024 03:50
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.

Move the flatten handling logic to the generator
4 participants