Skip to content

Array might be generated to "[]" #125

@zeerd

Description

@zeerd

Test Code:

input = {'$defs': {'OutputModel': {'properties': {'A': {'title': 'A', 'type': 'string'}, 'B': {'title': 'B', 'type': 'string'}}, 'required': ['A', 'B'], 'title': 'OutputModel', 'type': 'object'}}, 'properties': {'result': {'items': {'$ref': '#/$defs/OutputModel'}, 'title': 'Result', 'type': 'array'}}, 'required': ['result'], 'title': 'queryOutput', 'type': 'object'}
fake_generator = JSF(input)
example_data = fake_generator.generate()
print(example_data)

Result:

root@zzz:/home/zzz# python tt.py 
{'result': []}
root@zzz:/home/zzz# python tt.py 
{'result': [{'A': 'Enim molestias, architecto ipsum vitae', 'B': 'dolor'}, {'A': 'reprehenderit repellendus adipisicing Lorem amet a', 'B': 'ipsum architecto ut'}, {'A': 'tellus. esse esse', 'B': 'vitae dui vitae architecto'}]}

I find no parameters to limit jsf to generated one item for array at least.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions