3 ms·
With GPT 4, I was able to give it a JSON blob and asked it to generate a JSON schema definition to describe it. Then verified the generated schema, found a few
by Zanfa 4y ago
With GPT 4, I was able to give it a JSON blob and asked it to generate a JSON schema definition to describe it. Then verified the generated schema, found a few edge cases in the dataset where it wouldn’t validate, asked ChatGPT to add those exceptions to the schema under certain conditions. Then found out that the library I wanted to use only supported JSON schema draft 6, so I asked ChatGPT to rewrite it to accommodate that and verified it still works. Then kept asking it to add misc validations as I needed and that was it.
Took me maybe 10-15 minutes total, where it would have taken me hours to brush up on the multiple versions of JSON schema, since I’ve never really written it. Reading it is trivial though, so you can review the final output quickly.