File tree Expand file tree Collapse file tree
json_explorer/codegen/languages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,33 +87,30 @@ def create_template_config(
8787 """Create configuration from Go template."""
8888 match template_name :
8989 case "web-api" :
90- go_config = get_web_api_config ()
9190 return GeneratorConfig (
9291 package_name = "models" ,
9392 add_comments = True ,
9493 generate_json_tags = True ,
9594 json_tag_omitempty = True ,
96- language_config = go_config . __dict__ ,
95+ language_config = get_web_api_config (). to_dict () ,
9796 )
9897
9998 case "strict" :
100- go_config = get_strict_config ()
10199 return GeneratorConfig (
102100 package_name = "types" ,
103101 add_comments = True ,
104102 generate_json_tags = True ,
105103 json_tag_omitempty = False ,
106- language_config = go_config . __dict__ ,
104+ language_config = get_strict_config (). to_dict () ,
107105 )
108106
109107 case "modern" :
110- go_config = get_modern_config ()
111108 return GeneratorConfig (
112109 package_name = "main" ,
113110 add_comments = True ,
114111 generate_json_tags = True ,
115112 json_tag_omitempty = True ,
116- language_config = go_config . __dict__ ,
113+ language_config = get_modern_config (). to_dict () ,
117114 )
118115
119116 case _:
Original file line number Diff line number Diff line change @@ -96,35 +96,31 @@ def create_template_config(
9696 """Create configuration from Python template."""
9797 match template_name :
9898 case "dataclass" :
99- python_config = get_dataclass_config ()
10099 return GeneratorConfig (
101100 package_name = "models" ,
102101 add_comments = True ,
103- language_config = python_config . __dict__ ,
102+ language_config = get_dataclass_config (). to_dict () ,
104103 )
105104
106105 case "pydantic" :
107- python_config = get_pydantic_config ()
108106 return GeneratorConfig (
109107 package_name = "models" ,
110108 add_comments = True ,
111- language_config = python_config . __dict__ ,
109+ language_config = get_pydantic_config (). to_dict () ,
112110 )
113111
114112 case "typeddict" :
115- python_config = get_typeddict_config ()
116113 return GeneratorConfig (
117114 package_name = "types" ,
118115 add_comments = True ,
119- language_config = python_config . __dict__ ,
116+ language_config = get_typeddict_config (). to_dict () ,
120117 )
121118
122119 case "strict-dataclass" :
123- python_config = get_strict_dataclass_config ()
124120 return GeneratorConfig (
125121 package_name = "models" ,
126122 add_comments = True ,
127- language_config = python_config . __dict__ ,
123+ language_config = get_strict_dataclass_config (). to_dict () ,
128124 )
129125
130126 case _:
Original file line number Diff line number Diff line change 33"""
44
55import pytest
6- import logging
7-
8-
9- @pytest .fixture (scope = "session" , autouse = True )
10- def configure_logging ():
11- """Configure logging for tests."""
12- logging .basicConfig (
13- level = logging .WARNING , # Reduce noise during tests
14- format = "%(name)s - %(levelname)s - %(message)s" ,
15- )
166
177
188@pytest .fixture
You can’t perform that action at this time.
0 commit comments