Forum Discussion
6 Replies
Sort By
- HKosova
Alumni
Hi rajrahul9939,
Just to clarify - do you want to generate an example of JSON payload based on a schema definition? Or do you need a mock server that would return sample responses? Or something else?
- rajrahul9939Occasional Contributor
Hi HKosova
Thank you for your response.
I wanted to generate an example of JSON payload based on a method return type, same as swagger generate the response example.
Thank you
- HKosova
Alumni
You can use the Swagger Inflector Java library, specifically its ExampleBuilder class, to generate JSON examples. Here's sample code: