we have a spring boot microservice with swagger v3. I need to build a sample request payload json with dummy values 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 ?
Asked
Active
Viewed 349 times
0
-
1Does this answer your question -- [How to generate JSON examples from OpenAPI/Swagger model definition](https://stackoverflow.com/q/41408768/113116), [How to generate JSON examples from OpenAPI 3.0 YAML file](https://stackoverflow.com/q/55978052/113116)? – Helen Feb 06 '23 at 09:39
-
If you have filled your openapi.yaml with `example` values swagger ui will show the request with you example values. You can also import your yaml in postman and it will generate example requests based on the same values. – Arie Feb 06 '23 at 10:45
-
@Helen This is exactly what i am looking for. Thanks. Does similar library exists in javascript as well ? – David Decanio Feb 06 '23 at 10:50
-
1@DavidDecanio [openapi-sampler](https://www.npmjs.com/package/openapi-sampler) – Helen Feb 06 '23 at 10:56