# Can a Postman mock server use examples from the OpenAPI yml?

**URL:** <https://community.postman.com/t/can-a-postman-mock-server-use-examples-from-the-openapi-yml/16303>\
**Category:** Help Hub\
**Tags:** mock-server\
**Created:** [September 28, 2020, 6:58pm UTC](https://community.postman.com/t/can-a-postman-mock-server-use-examples-from-the-openapi-yml/16303 "2020-09-28T18:58:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan.hull](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@dan.hull](https://community.postman.com/u/dan.hull)\
**Post date:** [September 28, 2020, 6:58pm UTC](https://community.postman.com/t/can-a-postman-mock-server-use-examples-from-the-openapi-yml/16303/1 "2020-09-28T18:58:33Z")

</div>

> **Archived topic — some details may be out of date.**  
> Mock servers built from saved collection examples are still supported. Postman now also has **code-based mocks** : JavaScript request handlers plus a `config.yaml`, stored as files in your Git repository, which you can run locally or deploy. Create one in the app, or use the Postman CLI to generate one from an OpenAPI spec, collection or dataset (`postman mock generate`) and run it (`postman mock run`). See [About mocks](https://learning.postman.com/docs/design-apis/mock-apis/mocks/overview) and [Create a mock](https://learning.postman.com/docs/design-apis/mock-apis/mocks/create-a-mock).  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) can build and run mocks for you.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

I’ve got an openAPI spec with lots of example responses already specified in the .yml, but when I use it to create a mock server, it appears that only example responses created in postman show up on the mock server. Is there a way to enable the use of the example responses from the .yml with a postman mock server?

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [April 29, 2025, 3:34pm UTC](https://community.postman.com/t/can-a-postman-mock-server-use-examples-from-the-openapi-yml/16303/2 "2025-04-29T15:34:25Z")

</div>

Closed on April 29, 2025, 3:34pm UTC


