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
I've just discovered this library recently and it's quite nice, but there is a feature I was wondering if we could get add. The feature would be allow users to load their endpoints using a json file, similarly to what json server does. Thinking about user experience, maybe follow the below example:
var httpServer = new HttpServer();
httpServer.Config.FromJsonFile("path/to/json_spec.json");
* Trying 127.0.0.1:5000...
* Connected to localhost (127.0.0.1) port 5000 (#0)
> GET /hello-world HTTP/1.1
> Host: localhost:5000
> User-Agent: curl/7.83.1
> Accept: */*
> Authorization: Bearer ey...
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: Kestrel
< Transfer-Encoding: chunked
< CorrelationId: 00000000-0000-0000-0000-00000000
<
Hello from test route.json!
I would be happy to implement the pointed changes (with maybe some changes) in the project 😊
The text was updated successfully, but these errors were encountered:
phalvesr
changed the title
Allow for users to load their mocked endpoint via json spec file
Allow users to load their mocked endpoint via json spec file
Feb 4, 2023
Sorry for the very late response. Was super busy recently. Looks good to me but a bit difficult to find a time to implement. Pull requests are welcome.
I've just discovered this library recently and it's quite nice, but there is a feature I was wondering if we could get add. The feature would be allow users to load their endpoints using a json file, similarly to what json server does. Thinking about user experience, maybe follow the below example:
Considering a json spec file in the below format:
We can get the proposed experience with the following changes (using .Net 6 sintax):
Calling the endpoint, for example, the "hello-world" from the json example with the following curl command:
would produce the following output:
I would be happy to implement the pointed changes (with maybe some changes) in the project 😊
The text was updated successfully, but these errors were encountered: