dotnet / Scaffolding

Code generators to speed up development.
MIT License
639 stars 228 forks source link

minimalapi.json of aspnet-codegenerator has obsolete and incomplete options #2602

Closed pstricks-fans closed 9 months ago

pstricks-fans commented 10 months ago

Focus on the last two entries of minimalapi.json of aspnet-codegenerator.

{
  "Alias": "minimalapi",
  "Description": "Generates an endpoints file (with CRUD API endpoints) given a model and optional DbContext.",
  "Arguments": [
    {
      "Name": "-e|--endpoints",
      "Description": "Endpoints class to use. (not file name)"
    },
    {
      "Name": "-m|--model",
      "Description": "Model class to use"
    },
    {
      "Name": "-dc|--dataContext",
      "Description": "DbContext class to use"
    },
    {
      "Name": "-outDir|--relativeFolderPath",
      "Description": "Specify the relative output folder path from project where the file needs to be generated, if not specified, file will be generated in the project folder"
    },
    {
      "Name": "-o|--open",
      "Description": "Use this option to enable OpenAPI"
    },
    {
      "Name": "-namespace|--endpointsNamespace",
      "Description": "Specify the name of the namespace to use for the generated Endpoints file"
    },
    {
      "Name": "databaseProvider",
      "Description": "Database provider to use. Options include 'sqlserver' (default), 'sqlite', 'cosmos', 'postgres'."
    },
    {
      "Name": "useSqLite",
      "ShortName": "sqlite",
      "Description": "Flag to specify if DbContext should use SQLite instead of SQL Server."
    }
  ],
  "Options": []
}

- and -- are missing.

They should be

{
  "Name": "-dbProvider|--databaseProvider",
  "Description": "Database provider to use. Options (without quotes) include 'sqlserver' (default), 'sqlite', 'cosmos', 'postgres'. Example: -dbProvider sqlite" 
},
{
  "Name": "--useSqLite",
  "ShortName": "-sqlite",
  "Description": "Flag to specify if DbContext should use SQLite instead of SQL Server. As it is now obselete, use dbProvider instead."
}
captainsafia commented 10 months ago

The options here are controlled by the scaffolding layer. I'm going to move this issue to that repo with the hope that someone there might be able to explain what we are seeing here.

deepchoudhery commented 9 months ago

yup the useSqlite shouldn't be there and dbProvider should have the missing hyphens. will fix thanks.

deepchoudhery commented 9 months ago

Closing with #2603, will be reflected in .NET 9 Preview 1+