Skip to content

Add an option to inject the exact command used to generate the python module to the file header #2435

Open
@ExcellentAmericanEagle

Description

@ExcellentAmericanEagle

Is your feature request related to a problem? Please describe.
I think it'd be very useful to maintainers of the codebase to know exactly which command was used to generate the Python module, right in the generated code. I'd like this process to be as automatic as possible.

Describe the solution you'd like
I'd like to have a new flag - that if it's passed - it'll inject the full command in the file header.
Perhaps named --include-command-in-file-header

It cannot (?) coexist with other flags related to file header manipulation - e.g. --custom-file-header or (--custom-file-header-path. Just like:

`--custom_file_header_path` can not be used with `--custom_file_header`.

Or if passed with one of them, it'll append the command right to the end of the file header.

Describe alternatives you've considered

  • I can manually copy and paste the command to the generated file
  • I can store the command in README or in the docs
  • I can use the flag --custom-file-header="# datamodel-codegen --input ./public/schema.json ..."
  • I can store the generated command in some file (and the overall desired file header content), and then use the flag --custom-file-header-path=/path/to/header

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions