OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.38k stars 6.47k forks source link

[typescript-fetch] Is it possible to skip generating docstrings? (JSDoc) #16830

Open alexerhardt opened 11 months ago

alexerhardt commented 11 months ago
Description

I am passing --global-property=apiDocs=true,modelDocs=true to the typescript-fetch generator, and I would expect it to remove docs from the generated models and api functions, but that's not happening.

openapi-generator version

7.0.1

OpenAPI declaration file content or url
{
  "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
  "spaces": 2,
  "generator-cli": {
    "version": "7.0.1"
  }
Command line used for generation
openapi-generator-cli generate \
  -g typescript-fetch \
  -i ../schema.yaml \
  -o ./api \
  --global-property=apiDocs=false,modelDocs=false
Steps to reproduce
  1. Run the command
  2. Observe the model and api files: they are full of docstrings
Related issues/PRs

I'm searching high and low, I can't find anything.

Suggest a fix/enhancement

Maybe this is expected behavior. It would be cool to be able to remove docstrings, as the files would be more human-readable. At list by this human.

matki commented 1 month ago

Have you tried running

openapi-generator-cli generate \
  -g typescript-fetch \
  -i ../schema.yaml \
  -o ./api \
  --global-property apiDocs=false,modelDocs=false

? The difference is that there's no =between the global-property flag and the values