Skip to content

Commit f69da18

Browse files
butvinmclaude
andcommitted
Support --no-allow-remote-refs via BooleanOptionalAction
Use BooleanOptionalAction (like --use-annotated) so users can explicitly opt out with --no-allow-remote-refs from the CLI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2c325e6 commit f69da18

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/datamodel_code_generator/arguments.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,10 @@ def start_section(self, heading: str | None) -> None:
129129
"--allow-remote-refs",
130130
help="Allow fetching remote $ref references over HTTP/HTTPS. "
131131
"Currently remote fetching is allowed by default but emits a deprecation warning. "
132-
"Pass this flag explicitly to silence the warning. "
132+
"Pass --allow-remote-refs to opt in without warning, "
133+
"or --no-allow-remote-refs to block remote fetching. "
133134
"In a future version, remote fetching will be disabled by default.",
134-
action="store_true",
135+
action=BooleanOptionalAction,
135136
default=None,
136137
)
137138
base_options.add_argument(

0 commit comments

Comments
 (0)