swagger-api / swagger-codegen-generators

Apache License 2.0
284 stars 424 forks source link

Options have String values that are `boolean-type` #1227

Open Gussiny opened 11 months ago

Gussiny commented 11 months ago

There are some options on different languages that are string-type but the default values are boolean-type ( "true"/"false" ). I think since there are no limitations on using the boolean type, why not change these options to corresponding types to maintain consistency.

Options for Go language for a V3 Client, using the online generator ( https://generator3.swagger.io/api/options?language=go&version=V3 ):

{
  "packageName": {
    "opt": "packageName",
    "description": "Go package name (convention: lowercase).",
    "type": "string",
    "default": "swagger"
  },
  "hideGenerationTimestamp": {
    "opt": "hideGenerationTimestamp",
    "description": "Hides the generation timestamp when files are generated.",
    "type": "string",
    "default": "true"
  },
  "packageVersion": {
    "opt": "packageVersion",
    "description": "Go package version.",
    "type": "string",
    "default": "1.0.0"
  },
  "withXml": {
    "opt": "withXml",
    "description": "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)",
    "type": "boolean",
    "default": "false"
  }
}

The hideGenerationTimestamp option is a String with a boolean-type value by default ( "true" ), but we also have the option withXml that is boolean type with a default value of "false".