We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reproducer:
from typing import Tuple import pydantic import jsf class MyModel(pydantic.BaseModel): some_attr: Tuple[int, int] schema = MyModel.model_json_schema() print(schema) faker = jsf.JSF(schema) print(faker.generate())
Output:
{'properties': {'some_attr': {'maxItems': 2, 'minItems': 2, 'prefixItems': [{'type': 'integer'}, {'type': 'integer'}], 'title': 'Some Attr', 'type': 'array'}}, 'required': ['some_attr'], 'title': 'MyModel', 'type': 'object'} Traceback (most recent call last): File "/Users/dion/.virtualenvs/science/lib/python3.10/site-packages/jsf/schema_types/object.py", line 45, in generate return super().generate(context) File "/Users/dion/.virtualenvs/science/lib/python3.10/site-packages/jsf/schema_types/base.py", line 66, in generate raise ProviderNotSetException() jsf.schema_types.base.ProviderNotSetException During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Users/dion/codes/tesseract/jsf_bug.py", line 12, in <module> print(faker.generate()) File "/Users/dion/.virtualenvs/science/lib/python3.10/site-packages/jsf/parser.py", line 355, in generate return self.root.generate(context=context) File "/Users/dion/.virtualenvs/science/lib/python3.10/site-packages/jsf/schema_types/object.py", line 47, in generate explicit_properties = { File "/Users/dion/.virtualenvs/science/lib/python3.10/site-packages/jsf/schema_types/object.py", line 50, in <dictcomp> if self.should_keep(o.name, context) AttributeError: 'NoneType' object has no attribute 'name'
The text was updated successfully, but these errors were encountered:
Actually, this is triggered whenever an array is encountered that doesn't have a defined type via items.
items
Sorry, something went wrong.
No branches or pull requests
Reproducer:
Output:
The text was updated successfully, but these errors were encountered: