Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[object Object] header in OpenApi mocks #489

Open
vaiil opened this issue Feb 15, 2024 · 0 comments
Open

[object Object] header in OpenApi mocks #489

vaiil opened this issue Feb 15, 2024 · 0 comments

Comments

@vaiil
Copy link

vaiil commented Feb 15, 2024

Describe the bug
When I provide example for header, mocks-server produces response with header value [object Object]

To Reproduce
Create mocks for this openapi spec:

openapi: 3.0.3
info:
  title: test
  version: 0.0.1
paths:
  /products:
    get:
      tags:
        - products
      summary: Get products
      responses:
        '200':
          description: Get field list
          headers:
            X-Total-Count:
              schema:
                type: integer
                format: int64
                example: 5
              description: Total count of products
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
              examples:
                simple:
                  value:
                    - id: 1
                      name: "IPhone 11"
                    - id: 2
                      name: "Iphone 12"

Start server

Check the response header:

$ curl -vs http://localhost:3100/products 2>&1  | grep X-Total
#OUTPUT: < X-Total-Count: [object Object]

Expected behavior
Get the value from example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant