File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 4242 file_name : str
4343 json_schema_dict : dict [str , Any ]
4444 try : # marshmallow json schema approach (deprecated - to be phased out one after another)
45- file_name = schema_type .__name__ + ".json" # pylint:disable=invalid-name
45+ FILE_NAME = schema_type .__name__ + ".json" # pylint:disable=invalid-name
4646 schema_instance = schema_type ()
4747 if "requirement_indicator" in schema_instance .fields : # type:ignore[union-attr]
4848 # raises attribute error for pydantic classes
6161 field_dict ["requirement_indicator" ] = fields .String (name = "requirement_indicator" )
6262 json_schema_dict = json_schema .dump (schema_instance )
6363 except (AttributeError , ValidationError ): # means, we're creating a json schema from a pydantic class
64- file_name = schema_type .__name__ + "Schema.json" # other than for the marshmallow classes, we add 'Schema' here
64+ FILE_NAME = schema_type .__name__ + "Schema.json" # other than for the marshmallow classes, we add 'Schema' here
6565 assert hasattr (schema_type , "model_json_schema" )
6666 json_schema_dict = schema_type .model_json_schema ()
67- file_path = this_directory / file_name
67+ file_path = this_directory / FILE_NAME
6868 # We want our JSON schemas to be compatible with a typescript code generator:
6969 # https://github.com/bcherny/json-schema-to-typescript/
7070 # However there's an unresolved bug: The root level of the schema must not contain any '$ref' key.
You can’t perform that action at this time.
0 commit comments