Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Move to a plugin/command url scheme #148

Merged
merged 3 commits into from
Dec 28, 2015
Merged

Conversation

cocreature
Copy link
Collaborator

This changes the format of url requests from

curl -v -H "Content-Type: application/json" -X POST -d '{"cmd": "lint", "params":{"file":{"file":"/home/moritz/code/haskell/playground/src/Main.hs"}}}' http://localhost:8001/req/ghcmod

to

curl -v -H "Content-Type: application/json" -X POST -d '{"file":{"file":"/home/moritz/code/haskell/playground/src/Main.hs"}}' http://localhost:8001/req/ghcmod/lint

Imho this is a more intuitive. The double file parameter comes from the fact that the first is the parameter name and the second is the type so that’s nothing specific to the servant protocol.

@alanz
Copy link
Collaborator

alanz commented Dec 23, 2015

Looks like a good idea

@alanz
Copy link
Collaborator

alanz commented Dec 23, 2015

We need to come up with whatever scheme works best with swagger2, for documentation and tooling

@cocreature
Copy link
Collaborator Author

My understanding is that swagger is a standardized way to specify your api but doesn’t require it to be in a specific way, however I’m happy to be corrected here.

Also swagger or at least servant-swagger doesn’t seem particularly useful for the way our servant api currently looks since it only contains one route and doesn’t know about the plugins or the commands that exists so anything that tries to generate documentation from the servant type can’t document plugins and commands. Again I’m happy to be corrected here.

For the json stdio I’m currently writing a documentation generator that outputs rst, but I’m happy to later merge that with the swagger docs if they turn out to be useful or to merge our http docs into that.

alanz added a commit that referenced this pull request Dec 28, 2015
Move to a plugin/command url scheme
@alanz alanz merged commit 5e9f52a into haskell:master Dec 28, 2015
@alanz alanz added this to the prehistory milestone Feb 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants