Getting Example Value of request body
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Getting Example Value of request body
Hi,
we have a spring boot microservice with swagger v3. I need to build a sample request payload json for each path in api docs (exactly how the swagger ui builds a example value payload for each endpoint) . Is there any api provided by swagger to get the example payload directly ?
Regards,
Sagar
- Labels:
-
Swagger Codegen
-
Swagger Core
-
Swagger UI
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @sagarkancherla ,
I don't think there is any API or library that creates examples. It was a requested feature and something we'd like to have.
Here is an issue from 2019 requesting it: https://github.com/swagger-api/swagger-ui/issues/5343
And there may be more.
I haven't used it, but https://www.npmjs.com/package/openapi-sampler looks promising for generating JSON (maybe XML?) samples.
If you do get it to work for your use-case, post back and let us know!
