You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generate_from_file_object function has the arguments schema_file: FileLikeType and result_file: FileLikeType with FileLikeType = Union[TextIO, TextIOWrapper, FileIO].
\json_schema_for_humans\generate.py:93, in generate_from_file_object(schema_file, result_file, minify, deprecated_from_description, default_from_description, expand_buttons, copy_css, copy_js, link_to_reused_ref, config)
80 """Generate the JSON schema documentation from opened file objects for both input and output files. The
81 result_file should be opened in write mode.
82 """
83 config = config or get_final_config(
84 minify=minify,
85 deprecated_from_description=deprecated_from_description,
(...)
90 link_to_reused_ref=link_to_reused_ref,
91 )
---> 93 schemas_to_render = [SchemaToRender(schema_file, result_file, Path(result_file.name).parent)]
94 template_renderer = TemplateRenderer(config)
95 generate_schemas_doc(schemas_to_render, template_renderer)
AttributeError: '_io.StringIO' object has no attribute 'name'
The text was updated successfully, but these errors were encountered:
The
generate_from_file_object
function has the argumentsschema_file: FileLikeType
andresult_file: FileLikeType
withFileLikeType = Union[TextIO, TextIOWrapper, FileIO]
.However in
json-schema-for-humans/json_schema_for_humans/generate.py
Line 93 in 178c7b1
the code tries to access the property
.name
ofresult_file
. HoweverTextIOBase
objects don't have a.name
attribute.Example code like this
results in the following error.
The text was updated successfully, but these errors were encountered: