I am trying to set up a mock API to work on my client side app independent of efforts from my server side team. And I want these mocks to be more meaningful instead of simple mock data as provided by swagger out of the box.
I am using swagger project start -m to start serving the apis from the default http://localhost:10010/. And I am serving some mock jsons from /api/mocks/users.js which exports multiple methods.
I am using correct values inside my swagger-spec for x-swagger-router-controller and operationId.
And I have got one path /users return the mock values for both GET and POST
However whenever I am trying to connect /users/{user-id} with my mock controller, its returning 404.
I am starting to think dynamic paths like /users/{user-id} cannot be handled by mock mode. Am I right to think so or is there a way to mock such paths?
I ran into same issue,
Not sure but this seems to be the issue,
if you replace dash(-) with underscore( _ ) in the path, that seems to work. Trying to find a way around this.
Hello friends
I am trying to set up a mock API to work on my client side app independent of efforts from my server side team. And I want these mocks to be more meaningful instead of simple mock data as provided by swagger out of the box.
I am using
swagger project start -m
to start serving the apis from the defaulthttp://localhost:10010/
. And I am serving some mock jsons from/api/mocks/users.js
which exports multiple methods.I am using correct values inside my swagger-spec for
x-swagger-router-controller
andoperationId
.And I have got one path
/users
return the mock values for bothGET
andPOST
However whenever I am trying to connect
/users/{user-id}
with my mock controller, its returning404
.I am starting to think dynamic paths like
/users/{user-id}
cannot be handled by mock mode. Am I right to think so or is there a way to mock such paths?