Skip to content

Can I convert the defined JSON Schema into test data #1563

Closed Answered by ST-DDT
suncpp asked this question in Q&A
Discussion options

You must be logged in to vote

Short answer: Currently, there is no way to generate data from a json schema.
Long answer: You can build a method to generate the data yourself. I don't know how to read this schema though, so I cannot say how to write a method for it.

One of the issues with json schema is that it may contain info about the datatypes (string/number) but not on the actual types of data. (e.g. firstname or lastname). If you define a custom json schema to generate data with faker, than you can just write a method for it instead:

https://fakerjs.dev/guide/usage.html#create-complex-objects

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@suncpp
Comment options

Answer selected by suncpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants