You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm just trying to run a mock server that builds from a YAML OpenAPI spec. The setup steps in the OpenAPI guide seem to work perfectly for JSON.. but not for YAML.
Here's my config: (Bear mind, my usage of these entities may not be correct)
Now, I have one other OpenAPI spec file, mocks/documents/alt.json. When I switch to using that one instead of mocks/documents/api.yaml, it works without issue.
My guess is it's an issue with the YAML support in the mocks-server library (Which is why I'm bringing it here).
Hi @Rcuz8 ,
I suppose it may be related to the usage of $ref in yaml files. Just to confirm, does it work if you replace the ref directly by the yaml content of the other file?
Describe the bug
I'm just trying to run a mock server that builds from a YAML OpenAPI spec. The setup steps in the OpenAPI guide seem to work perfectly for JSON.. but not for YAML.
Here's my config: (Bear mind, my usage of these entities may not be correct)
mocks/documents/api.yaml
: (Basic api spec, validated on http://www.yamllint.com/)mocks/openapi/definitions.yaml
: (Basic definitions file)mocks/collections.json
: (Basic collections file)mocks.config.js
: (Default mocks-server config file)When I run
npx mocks-server
, I see this error:Now, I have one other OpenAPI spec file,
mocks/documents/alt.json
. When I switch to using that one instead ofmocks/documents/api.yaml
, it works without issue.My guess is it's an issue with the YAML support in the
mocks-server
library (Which is why I'm bringing it here).To Reproduce
Follow the steps in the Installation and OpenAPI integration guides
Expected behavior
I expect the server to start without error and serve the endpoints defined in
api.yaml
.Logs
If applicable, add logs to help explain your problem.
** Operating system, Node.js an npm versions, or browser version (please complete the following information):**
v20.11.0
10.2.4
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: