Generate sample Json output from Json Schema

后端 未结 4 1364
栀梦
栀梦 2020-12-30 20:15

I want to know whether there is a method in which I can generate sample json output based on a json schema input.

for example :-

input =>

{
\"tit         


        
相关标签:
4条回答
  • 2020-12-30 20:59

    You can also use the ModelObject in Adobe Ride (full disclosure: self-plug here). Point the ModelObject (or a subclass thereof) to a schema in your java project resources: https://github.com/adobe/ride/blob/develop/sample/sample-service-extension/src/test/java/com/adobe/ride/sample/tests/ObjectCreation.java#L38

    You can also use the Ride Fuzzer Lib to easily tests sending negative data into the schema nodes (based on an array of OWASP and google injection test strings, and other various types data): https://github.com/adobe/ride/tree/develop/libraries/ride-fuzzer-lib

    All Ride modules are open source and free: https://github.com/adobe/ride/

    0 讨论(0)
  • 2020-12-30 21:07

    JSONBuddy can do this for you. It is a Windows desktop JSON editor and generates live JSON sample data while you are editing your schema.

    0 讨论(0)
  • 2020-12-30 21:12

    fake-schema-cli is another option you can use.

    Example: fake-schema file-input-schema.json > output.json.

    0 讨论(0)
  • 2020-12-30 21:17

    You can try the JSON Schema Faker. It will take a schema and generate/output a JSON object that will validate against the schema.

    0 讨论(0)
提交回复
热议问题