Repository: koxudaxi/datamodel-code-generator

Issue:
(🎁) Log input file type when when `--input-file-type` is `auto`
I was left a little confused when my json file was silently detected as jsonschema instead of json.

Discussion:
codecov[bot]: ## [Codecov](https://codecov.io/gh/koxudaxi/datamodel-code-generator/pull/1248?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono) Report
Patch coverage: **`99.40`**% and project coverage change: **`-0.51`** :warning:
> Comparison is base [(`e9b6edf`)](https://codecov.io/gh/koxudaxi/datamodel-code-generator/commit/e9b6edfc2e2ace195cb465e2e980fb78c22c3fd9?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono) 100.00% compared to head [(`4c2cd76`)](https://codecov.io/gh/koxudaxi/datamodel-code-generator/pull/1248?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono) 99.49%.

> :exclamation: Current head 4c2cd76 differs from pull request most recent head a820ee6. Consider uploading reports for the commit a820ee6 to get more accurate results

<details><summary>Additional details and impacted files</summary>


```diff
@@             Coverage Diff             @@
##            master    #1248      +/-   ##
===========================================
- Coverage   100.00%   99.49%   -0.51%     
===========================================
  Files           11       25      +14     
  Lines         1020     3195    +2175     
  Branches       201      644     +443     
===========================================
+ Hits          1020     3179    +2159     
- Misses           0       16      +16     
```

| Flag | Coverage Δ | |
|---|---|---|
| unittests | `99.43% <99.33%> (?)` | |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/koxudaxi/datamodel-code-generator/pull/1248?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono) | Coverage Δ | |
|---|---|---|
| [datamodel\_code\_generator/\_\_init\_\_.py](https://codecov.io/gh/koxudaxi/datamodel-code-generator/pull/1248?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono#diff-ZGF0YW1vZGVsX2NvZGVfZ2VuZXJhdG9yL19faW5pdF9fLnB5) | `91.11% <85.32%> (ø)` | |
| [datamodel\_code\_generator/\_\_main\_\_.py](https://codecov.io/gh/koxudaxi/datamodel-code-generator/pull/1248?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono#diff-ZGF0YW1vZGVsX2NvZGVfZ2VuZXJhdG9yL19fbWFpbl9fLnB5) | `100.00% <100.00%> (ø)` | |
| [datamodel\_code\_generator/format.py](https://codecov.io/gh/koxudaxi/datamodel-code-generator/pull/1248?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono#diff-ZGF0YW1vZGVsX2NvZGVfZ2VuZXJhdG9yL2Zvcm1hdC5weQ==) | `100.00% <100.00%> (ø)` | |
| [datamodel\_code\_generator/http.py](https://codecov.io/gh/koxudaxi/datamodel-code-generator/pull/1248?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono#diff-ZGF0YW1vZGVsX2NvZGVfZ2VuZXJhdG9yL2h0dHAucHk=) | `100.00% <100.00%> (ø)` | |
| [datamodel\_code\_generator/imports.py](https://codecov.io/gh/koxudaxi/datamodel-code-generator/pull/1248?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono#diff-ZGF0YW1vZGVsX2NvZGVfZ2VuZXJhdG9yL2ltcG9ydHMucHk=) | `100.00% <100.00%> (ø)` | |
| [datamodel\_code\_generator/model/\_\_init\_\_.py](https://codecov.io/gh/koxudaxi/datamodel-code-generator/pull/1248?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono#diff-ZGF0YW1vZGVsX2NvZGVfZ2VuZXJhdG9yL21vZGVsL19faW5pdF9fLnB5) | `100.00% <100.00%> (ø)` | |
| [datamodel\_code\_generator/model/base.py](https://codecov.io/gh/koxudaxi/datamodel-code-generator/pull/1248?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono#diff-ZGF0YW1vZGVsX2NvZGVfZ2VuZXJhdG9yL21vZGVsL2Jhc2UucHk=) | `100.00% <100.00%> (ø)` | |
| [datamodel\_code\_generator/model/dataclass.py](https://codecov.io/gh/koxudaxi/datamodel-code-generator/pull/1248?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono#diff-ZGF0YW1vZGVsX2NvZGVfZ2VuZXJhdG9yL21vZGVsL2RhdGFjbGFzcy5weQ==) | `100.00% <100.00%> (ø)` | |
| [datamodel\_code\_generator/model/enum.py](https://codecov.io/gh/koxudaxi/datamodel-code-generator/pull/1248?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono#diff-ZGF0YW1vZGVsX2NvZGVfZ2VuZXJhdG9yL21vZGVsL2VudW0ucHk=) | `100.00% <100.00%> (ø)` | |
| [datamodel\_code\_generator/model/improts.py](https://codecov.io/gh/koxudaxi/datamodel-code-generator/pull/1248?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono#diff-ZGF0YW1vZGVsX2NvZGVfZ2VuZXJhdG9yL21vZGVsL2ltcHJvdHMucHk=) | `100.00% <100.00%> (ø)` | |
| ... and [15 more](https://codecov.io/gh/koxudaxi/datamodel-code-generator/pull/1248?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono) | |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono)

</details>

[:umbrella: View full report in Codecov by Sentry](https://codecov.io/gh/koxudaxi/datamodel-code-generator/pull/1248?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono).   
:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Koudai+Aono).

KotlinIsland: Maybe this could mention the `--input-file-type` option 

Patch:
diff --git a/datamodel_code_generator/__init__.py b/datamodel_code_generator/__init__.py
index b78d25f8..55285754 100644
--- a/datamodel_code_generator/__init__.py
+++ b/datamodel_code_generator/__init__.py
@@ -2,6 +2,7 @@ from __future__ import annotations
 
 import contextlib
 import os
+import sys
 from datetime import datetime, timezone
 from enum import Enum
 from pathlib import Path
@@ -308,6 +309,10 @@ def generate(
                 if is_openapi(input_text_)  # type: ignore
                 else InputFileType.JsonSchema
             )
+            print(
+                f'The input file type was determined to be: {input_file_type.value}',
+                file=sys.stderr,
+            )
         except:  # noqa
             raise Error('Invalid file format')
 


Test patch:
diff --git a/tests/test_main.py b/tests/test_main.py
index d5ce25d1..1f9a5bce 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -588,7 +588,7 @@ def test_main_no_file(capsys: CaptureFixture) -> None:
     assert (
         captured.out == (EXPECTED_MAIN_PATH / 'main_no_file' / 'output.py').read_text()
     )
-    assert not captured.err
+    assert captured.err == 'The input file type was determined to be: openapi\n'
 
 
 def test_main_extra_template_data_config(capsys: CaptureFixture) -> None:
@@ -614,7 +614,7 @@ def test_main_extra_template_data_config(capsys: CaptureFixture) -> None:
             EXPECTED_MAIN_PATH / 'main_extra_template_data_config' / 'output.py'
         ).read_text()
     )
-    assert not captured.err
+    assert captured.err == 'The input file type was determined to be: openapi\n'
 
 
 def test_main_custom_template_dir_old_style(capsys: CaptureFixture) -> None:
@@ -641,7 +641,7 @@ def test_main_custom_template_dir_old_style(capsys: CaptureFixture) -> None:
         captured.out
         == (EXPECTED_MAIN_PATH / 'main_custom_template_dir' / 'output.py').read_text()
     )
-    assert not captured.err
+    assert captured.err == 'The input file type was determined to be: openapi\n'
 
 
 def test_main_custom_template_dir(capsys: CaptureFixture) -> None:
@@ -668,7 +668,7 @@ def test_main_custom_template_dir(capsys: CaptureFixture) -> None:
         captured.out
         == (EXPECTED_MAIN_PATH / 'main_custom_template_dir' / 'output.py').read_text()
     )
-    assert not captured.err
+    assert captured.err == 'The input file type was determined to be: openapi\n'
 
 
 @freeze_time('2019-07-26')
diff --git a/tests/test_main_kr.py b/tests/test_main_kr.py
index ca261f59..d8949825 100644
--- a/tests/test_main_kr.py
+++ b/tests/test_main_kr.py
@@ -146,7 +146,7 @@ def test_main_no_file(capsys: CaptureFixture) -> None:
         == (EXPECTED_MAIN_KR_PATH / 'main_no_file' / 'output.py').read_text()
     )
 
-    assert not captured.err
+    assert captured.err == 'The input file type was determined to be: openapi\n'
 
 
 def test_main_custom_template_dir(capsys: CaptureFixture) -> None:
@@ -175,7 +175,7 @@ def test_main_custom_template_dir(capsys: CaptureFixture) -> None:
             EXPECTED_MAIN_KR_PATH / 'main_custom_template_dir' / 'output.py'
         ).read_text()
     )
-    assert not captured.err
+    assert captured.err == 'The input file type was determined to be: openapi\n'
 
 
 @freeze_time('2019-07-26')