#992·mockoon

[mockoon-cli] also return OpenAPI examples

Author: franokCreated Mar 27, 2023Updated Jun 3, 2026
Labelscomponent:lib-commonsstatus:need-more-interest

relates to #962

Given

mockoon cli is used with openapi.yaml that contains examples:

mockoon-cli start --data https://raw.githubusercontent.com/mockoon/mockoon/d091b91c6c67b13fb40343fec0fe0287a1db2183/packages/commons-server/test/data/openapi/openapi-v3.yaml --daemon-off

When

GET http://localhost:3000/with-examples

Then

The response is never one of the examples defined in the openapi yml, but always a generated one, e.g.:

[
  {
    "id": 33724,
    "name": ""
  }
]

Expected behavior

randomizing the example responses by default

Note: created this issue as requested by @255kb in https://github.com/mockoon/mockoon/issues/962#issuecomment-1484586133