Questions about Mock Mode and Multiple Swagger Files
lyt0802 opened this issue · 0 comments
lyt0802 commented
I have two questions regarding mock mode and multiple swagger files:
- 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.
- I traced through the code and noticed that the yaml file that is loaded is always Swagger.yaml.
I see from this post (#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?