Forum Discussion
- HKosovaSmartBear Alumni (Retired)
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
- HKosovaSmartBear Alumni (Retired)
You can use the Swagger Inflector Java library, specifically its ExampleBuilder class, to generate JSON examples. Here's sample code:
Related Content
- 12 months ago
- 12 months ago
- 2 years ago