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

Kiota generates more model classes than are necessary for "sliced" Microsoft Graph APIs #2543

Closed
darrelmiller opened this issue Apr 10, 2023 · 1 comment · Fixed by #2580 or #2582
Closed
Assignees
Labels
enhancement New feature or request generator Issues or improvements relater to generation capabilities. WIP
Milestone

Comments

@darrelmiller
Copy link
Member

When generating a model class that derives from a base class, it automatically generates the model for all types derived from that base class. For Microsoft Graph this causes us to generate a model for every entity as soon as we need one model derived from entity. This makes the slicing have a minimum size of more than 3MB DLL in CSharp.

We need to find a way of not generating models for derived types that are not actually used.

@baywet baywet self-assigned this Apr 10, 2023
@baywet baywet added enhancement New feature or request generator Issues or improvements relater to generation capabilities. and removed Needs: Triage 🔍 labels Apr 10, 2023
@baywet baywet added this to the Kiota v1.2 milestone Apr 10, 2023
@baywet baywet added this to Kiota Apr 10, 2023
@github-project-automation github-project-automation bot moved this to Todo in Kiota Apr 10, 2023
@baywet
Copy link
Member

baywet commented Apr 11, 2023

Models end up being projected because a lot of things derive from entity and because of the discriminator aspect. We could implement ref counting (we already have an inheritance index) of the models, excluding discriminator mappings from that counting mechanism, and then trim all models who's base type have a count of zero before we hand over to the refiners. Or something along those lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request generator Issues or improvements relater to generation capabilities. WIP
Projects
Archived in project
2 participants