Skip to content

body_from_file does not work in Standalone mock server #185

Closed

Description

@aaronenberg

I would like to create a standalone mock that can serve a response from a binary file, e.g.:

when:
  method: GET
  path: /data
then:
  status: 200
  body_from_file: data.zip

Currently, the mock server will parse this but not throw any errors, so at first it seems to be acceptable.
When a request matches the when clause, the response returns 200, but no data is returned and no error is thrown in the mock server logs.

Activity

  1. alexliesenfeld commented on Oct 15, 2025

    @alexliesenfeld
    Member

    Could be related to #183

  2. jayvdb commented on Oct 15, 2025

    @jayvdb
    Contributor

    @aaronenberg , #183 has been merged to master ; does that solve your problem?

  3. alexliesenfeld commented on Oct 17, 2025

    @alexliesenfeld
    Member

    As far as I understand, @aaronenberg wants to be able to provide a file name/path as in

    then:
      ...
      body_from_file: data.zip

    The server would read the file contents and use them as the response body. This lets multiple YAML definitions reuse the same payload without duplicating the content across files.

  4. added
    enhancement
    on Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions