@@ -59,6 +59,7 @@ dev = [
5959 " ty~=0.0.0" ,
6060 " types-colorama<0.5.0" ,
6161 " werkzeug<4.0.0" , # Werkzeug is used by pytest-httpserver
62+ " datamodel-code-generator[http,ruff]<1.0.0" ,
6263]
6364
6465[tool .hatch .build .targets .wheel ]
@@ -139,6 +140,11 @@ indent-style = "space"
139140 " N999" , # Invalid module name
140141 " T201" , # print found
141142]
143+ "src/apify_client/_models.py" = [
144+ " D" , # Everything from the pydocstyle
145+ " E501" , # Line too long
146+ " ERA001" , # Commented-out code
147+ ]
142148
143149[tool .ruff .lint .flake8-quotes ]
144150docstring-quotes = " double"
@@ -180,6 +186,7 @@ exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:", "assert_never()"]
180186[tool .ipdb ]
181187context = 7
182188
189+ <<<<<<< HEAD
183190# Run tasks with: uv run poe <task>
184191[tool .poe .tasks ]
185192clean = " rm -rf .coverage .pytest_cache .ruff_cache .ty_cache build dist htmlcov"
@@ -215,3 +222,23 @@ cwd = "website"
215222[tool .poe .tasks .run-docs ]
216223shell = " ./build_api_reference.sh && corepack enable && yarn && uv run yarn start"
217224cwd = " website"
225+ =======
226+ # https://koxudaxi.github.io/datamodel-code-generator/
227+ [tool .datamodel-codegen ]
228+ # url = "https://docs.apify.com/api/openapi.json"
229+ input = " ../apify-docs/static/api/openapi.json"
230+ input_file_type = " openapi"
231+ output = " src/apify_client/_models.py"
232+ target_python_version = " 3.10"
233+ output_model_type = " pydantic_v2.BaseModel"
234+ use_schema_description = true
235+ use_field_description = true
236+ use_union_operator = true
237+ capitalise_enum_members = true
238+ collapse_root_models = true
239+ set_default_enum_member = true
240+ use_annotated = true
241+ wrap_string_literal = true
242+ snake_case_field = true
243+ formatters = [" ruff-check" , " ruff-format" ]
244+ >>>>>>> af344d1 (Introduce fully typed clients)
0 commit comments