Skip to content

Commit 88c5c74

Browse files
butvinmclaude
andcommitted
Add @pytest.mark.cli_doc marker for --allow-remote-refs
CLI reference docs will be auto-generated by CI from this marker. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4ece0ef commit 88c5c74

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

tests/main/jsonschema/test_main_jsonschema.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -827,8 +827,28 @@ def test_main_root_id_jsonschema_with_local_file(mocker: MockerFixture, output_f
827827
httpx_get_mock.assert_not_called()
828828

829829

830+
@pytest.mark.cli_doc(
831+
options=["--allow-remote-refs"],
832+
option_description="""Enable fetching of `$ref` targets over HTTP/HTTPS.
833+
834+
When enabled, the generator will resolve `$ref` references that point to remote URLs,
835+
including relative refs resolved against a schema's `$id` base URL. This is required
836+
for schemas that reference definitions hosted on external servers.
837+
838+
Automatically enabled when using `--url` input.""",
839+
input_schema="jsonschema/root_id.json",
840+
cli_args=["--allow-remote-refs"],
841+
golden_output="main/jsonschema/root_id.py",
842+
)
830843
def test_main_root_id_jsonschema_with_remote_file(mocker: MockerFixture, tmp_path: Path) -> None:
831-
"""Test root ID JSON Schema with remote file reference."""
844+
"""Enable fetching of `$ref` targets over HTTP/HTTPS.
845+
846+
When enabled, the generator will resolve `$ref` references that point to remote URLs,
847+
including relative refs resolved against a schema's `$id` base URL. This is required
848+
for schemas that reference definitions hosted on external servers.
849+
850+
Automatically enabled when using `--url` input.
851+
"""
832852
root_id_response = mocker.Mock()
833853
root_id_response.text = "dummy"
834854
person_response = mocker.Mock()
@@ -945,7 +965,6 @@ def test_main_root_id_jsonschema_with_absolute_local_file(output_file: Path) ->
945965
)
946966

947967

948-
@pytest.mark.cli_doc(options=["--allow-remote-refs"])
949968
def test_main_remote_ref_blocked_by_default(tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None:
950969
"""Test that remote $ref fetching is blocked when --allow-remote-refs is not set."""
951970
schema = {

0 commit comments

Comments
 (0)