Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options have String values that are boolean-type #1227

Open
Gussiny opened this issue Dec 5, 2023 · 0 comments
Open

Options have String values that are boolean-type #1227

Gussiny opened this issue Dec 5, 2023 · 0 comments

Comments

@Gussiny
Copy link

Gussiny commented Dec 5, 2023

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant