json-schema-to-typescript icon indicating copy to clipboard operation
json-schema-to-typescript copied to clipboard

--bannerComment seems to be ignored by the cli

Open straz opened this issue 4 months ago • 0 comments

I tried providing a --bannerComment param to the CLI, but it seems to be ignored.

% npx json2ts -i 'myschema.yml' -o ./mytemplates/ --bannerComment "$(cat ./banner.txt)"
# -> banner.txt is ignored in the generated output, default banner is used instead.

It doesn't come up in the --help text either:

% npx json2ts --help

json-schema-to-typescript 15.0.4
Usage: json2ts [--input, -i] [IN_FILE] [--output, -o] [OUT_FILE] [OPTIONS]

With no IN_FILE, or when IN_FILE is -, read standard input.
With no OUT_FILE and when IN_FILE is specified, create .d.ts file in the same directory.
With no OUT_FILE nor IN_FILE, write to standard output.

You can use any of the following options by adding them at the end.
Boolean values can be set to false using the 'no-' prefix.

  --additionalProperties
      Default value for additionalProperties, when it is not explicitly set
  --cwd=XXX
      Root directory for resolving $ref
  --declareExternallyReferenced
      Declare external schemas referenced via '$ref'?
  --enableConstEnums
      Prepend enums with 'const'?
  --inferStringEnumKeysFromValues
      Create enums from JSON enums instead of union types
  --format
      Format code? Set this to false to improve performance.
  --maxItems
      Maximum number of unioned tuples to emit when representing bounded-size
      array types, before falling back to emitting unbounded arrays. Increase
      this to improve precision of emitted types, decrease it to improve
      performance, or set it to -1 to ignore minItems and maxItems.
  --style.XXX=YYY
      Prettier configuration
  --unknownAny
      Output unknown type instead of any type
  --unreachableDefinitions
      Generates code for definitions that aren't referenced by the schema

straz avatar Aug 06 '25 15:08 straz