Generated Management models are tightly coupled to an environment since they use ID references. Typically we find that we have multiple environments in our Kontent.ai projects. When creating tools that utilize the Management SDK is becomes difficult to manage n number of models based the number of environments present.
Proposed solution
Create a new KontentElementCodenameAttribute in the Management SDK to reference fields using codenames instead of IDs.
Update model generation to include a new app setting that controls whether to use KontentElementIdAttribute or KontentElementCodenameAttribute. By default the tool would use KontentElementIdAttribute to prevent breaking changes. Perhaps in a major release we could swap to using KontentElementCodenameAttribute as the default.
Hello Nick, thank you for the submission. I certainly think this makes sense and will prioritize it during my upcoming OS maintenance week, thank you for your patience.
Motivation
Generated Management models are tightly coupled to an environment since they use ID references. Typically we find that we have multiple environments in our Kontent.ai projects. When creating tools that utilize the Management SDK is becomes difficult to manage n number of models based the number of environments present.
Proposed solution
KontentElementCodenameAttribute
in the Management SDK to reference fields using codenames instead of IDs.KontentElementIdAttribute
orKontentElementCodenameAttribute
. By default the tool would useKontentElementIdAttribute
to prevent breaking changes. Perhaps in a major release we could swap to usingKontentElementCodenameAttribute
as the default.Additional context
N/A