Skip to content

Reference a file as the response body instead of inline JSON #59

@harrymt

Description

@harrymt

We want to return large data sets in our application and have trouble editing the inline JSON inside of the YAML config file.

Can mockingjay-server include an optional reference to a separate JSON file in an endpoint that means we can edit the JSON in a JSON formatted file, instead of editing inline JSON in a YAML file.

e.g. the config could look like this

- name: My endpoint
  request:
    uri: /api/count
    method: POST
    headers:
      content-type: application/json
    body: '{
      "data": [],
    }'
  response:
    code: 200
    # Replace the `body` property with a reference to a JSON file
    bodyAsFile: './my-endpoint-response.json'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions