Kontent.Ai.ModelGenerator 11.0.0-rc.2
Pre-releaseFixed
-
The tool no longer ships the Visual Basic compiler.
Microsoft.CodeAnalysisis the meta-package; only the C# syntax and workspace formatting APIs are used, so it now referencesMicrosoft.CodeAnalysis.CSharp.Workspacesdirectly. -
A blank comment argument reports
ArgumentExceptionrather thanArgumentNullException. The value is present, just empty — the two are different mistakes, and the tests had frozen the wrong one. -
Generated members are ordered ordinally rather than by the current culture, so the same content model produces the same file on every machine.
-
appSettings.jsonnames the option the tool actually reads. It still listedBaseClass, which was renamed toBaseRecord. -
The startup banner no longer reports success before anything is generated. A failed run's first line was "Models were generated for …"; it now says what it is about to do.
-
IClassCodeGeneratorFactorycovers both emitters. It offered only the Delivery generator while the Management path constructed its own directly — a seam that looked like the way in and was not. It now has a method per emitter, and the Management path goes through it. -
The config-file documentation matches where the tool actually looks. The README described
appSettings.jsonas living beside the executable; the tool reads it from the working directory, and as adotnet toolit has no executable directory to speak of. The file is also not installed with the tool, so the README now points at it as a template to copy. -
Management mode no longer skips elements over identifiers it never emits. Every content type reserved the names the Delivery emitter uses for its codename constants —
{Property}Codenamefor each element, plus the type's ownContentTypeCodename— regardless of mode. The Management emitter writes none of those, so the reservation only rejected valid input there: a type carrying bothtitleandtitle_codenamehad the second skipped with a collision warning, and an element codenamedcontent_type_codenamewas renamed for no reason. Constant registration is now the Delivery emitter's, so Management mode has the whole identifier space its own output uses. -
--baseRecordis rejected at startup when it is not a valid C# record name.-b "My-Base"wrotepublic partial record My-Baseand an extender deriving every generated model from it, so the whole output failed to compile over one argument. The name is checked before any API call and reported like any other configuration problem. -
Forgetting
--managementnow fails instead of generating Delivery models. Validation accepted the union of both modes' parameters while binding only ever applied the active mode's, so-k(or--apiKey) without-mwas accepted, dropped, and the run continued as a full Delivery generation - writing Delivery models over whatever was in the output directory and exiting0. The reverse dropped the Delivery-only-p/--projectidin Management mode and then failed with a message about an emptyEnvironmentId, which read as a configuration problem rather than a wrong flag. Each argument is now checked against the mode that is actually running, and one that belongs to the other mode names the mode switch:-k configures the Management API. Add --management (or -m) to generate from it.The same check now covers the section-qualified form (
--ManagementOptions:ApiKeywithout--management, and--DeliveryOptions:*with it), which bound straight into configuration without needing a switch mapping and so slipped past the mode entirely. Only command-line arguments are checked - anappSettings.jsoncarrying both sections is unaffected, and the section belonging to the mode you run is the one that is read. -
--nullabilityis refused in Management mode instead of accepted and ignored. It selects how generated Delivery models express nullability. Management models are uniformly nullable by contract - anullproperty is omitted from the upsert payload, which is how you leave an element untouched - so there was never anything for the flag to select there. The parameter table already documented it as Delivery-only; now the tool enforces it. -
--managementtogether with--baseRecordno longer emits code that cannot compile. The generated base record and its extender both carried a hardcodedusing Kontent.Ai.Delivery.Abstractions;. A project generated for the Management SDK has no reason to reference the Delivery SDK, so that line was aCS0246in a file the consumer never wrote. Neither it nor theusing System;beside it was referenced by the emitted code in either mode; both are gone.
Installation
dotnet add package Kontent.Ai.ModelGenerator --prereleaseFull changelog: src/model-generator/CHANGELOG.md