Skip to content
New issue

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

crash when I try to generate a json from a json schema: first case #7

Open
krl91 opened this issue Aug 20, 2020 · 0 comments
Open

crash when I try to generate a json from a json schema: first case #7

krl91 opened this issue Aug 20, 2020 · 0 comments

Comments

@krl91
Copy link

krl91 commented Aug 20, 2020

Hi,
I'm using Python 3.8 and I did a fresh install like this "pip install faker-schema" in a "venv"

I create a python file and write that:

import json

from faker_schema.faker_schema import FakerSchema
from faker_schema.schema_loader import load_json_from_file, load_json_from_string

schema = load_json_from_file('file.schema.json')
faker = FakerSchema()
data = faker.generate_fake(schema)

Then when I execute it I have this result:

(json) C:\Users\user\git\json>python generate.py
Traceback (most recent call last):
  File "generate.py", line 8, in <module>
    data = faker.generate_fake(schema)
  File "C:\Users\user\git\json\lib\site-packages\faker_schema\faker_schema.py", line 10, in generate_fake
    result = [self._generate_one_fake(schema) for _ in range(iterations)]
  File "C:\Users\user\git\json\lib\site-packages\faker_schema\faker_schema.py", line 10, in <listcomp>
    result = [self._generate_one_fake(schema) for _ in range(iterations)]
  File "C:\Users\user\git\json\lib\site-packages\faker_schema\faker_schema.py", line 31, in _generate_one_fake
    data[k] = getattr(self._faker, v)()
  File "C:\Users\user\git\json\lib\site-packages\faker\proxy.py", line 97, in __getattr__
    return getattr(self._factories[0], attr)
AttributeError: 'Generator' object has no attribute 'http://json-schema.org/draft-07/schema#'

Thank you

@krl91 krl91 changed the title crash when I try to generate a json from a json shema crash when I try to generate a json from a json schema Aug 20, 2020
@krl91 krl91 changed the title crash when I try to generate a json from a json schema crash when I try to generate a json from a json schema: first case Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant