Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Questions about Mock Mode and Multiple Swagger Files #572

Open
lyt0802 opened this issue Aug 23, 2018 · 0 comments
Open

Questions about Mock Mode and Multiple Swagger Files #572

lyt0802 opened this issue Aug 23, 2018 · 0 comments

Comments

@lyt0802
Copy link

lyt0802 commented Aug 23, 2018

I have two questions regarding mock mode and multiple swagger files:

  1. I was reading through the docs (https://github.com/swagger-api/swagger-node/blob/master/docs/mock-mode.md) and i found that it mentions:

By default, mock mode returns programmed responses, like "Sample text" for a string, a number for an integer, and so on.

However, when I write my swagger documentation in yaml, in the response, i can add an example for any response field as such:

id:
  type: "string"
  example: "abc_1234"

and in the swagger editor, the response would show the value that i set in the example instead of just "string".
Is there a way to have the same kind of interface when running in mock mode? I cannot seem to find anything that talks about this topic.

  1. I traced through the code and noticed that the yaml file that is loaded is always Swagger.yaml.
    I see from this post (Change default location of swagger.yml and api controllers #373) that you can override the config.
    However, because I have multiple apis spread out over multiple yaml files, I am wondering if it is possible to load all those files together?
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant