kontent-ai / model-generator-net

Kontent.ai .NET model generator.
https://www.nuget.org/packages/Kontent.Ai.ModelGenerator
MIT License
17 stars 19 forks source link

5.0.0-beta2 - Command "-s" does not work #96

Closed xantari closed 4 years ago

xantari commented 4 years ago

Brief bug description

Running following

dotnet tool restore dotnet tool run KontentModelGenerator -p "myguid" -o "..\Models\ContentTypes" -n "ARRT.Apps.Web.Models" -g -s True -f "Generated" -b "ContentTypeBase"

Get this error:

PM> .\GenerateModels.ps1 Tool 'kentico.kontent.modelgenerator' (version '5.0.0-beta2') was restored. Available commands: KontentModelGenerator Tool 'dotnet-ef' (version '3.1.0') was restored. Available commands: dotnet-ef

Restore was successful. Failed to convert '-s' to type 'System.Boolean'.

I've tried true, True, and "true" but nothing seems to work. Previous version when you included -s it would generate it with IRichText, but when I just have "-s" without the boolean flag it gives same boolean error

Repro steps

See above

Expected behavior

Should generate models

Test environment

5.0.0-beta2 command line tools

petrsvihlik commented 4 years ago

hi @xantari , there was a change in the v4 generator that allowed support of the Preview API/Secure API keys but unfortunately, the CLI no longer supports switches without values explicitly defined.

the correct syntax is dotnet tool run KontentModelGenerator -p "myguid" -o "..\Models\ContentTypes" -n "ARRT.Apps.Web.Models" -g True -s True -f "Generated" -b "ContentTypeBase"

More info at https://github.com/Kentico/kontent-generators-net/blob/master/README.md#cli-syntax