Skip to content

Endpoints on example's Readme are no longer in sync with code #33

@penntaylor

Description

@penntaylor

README for the example server lists the following endpoints, but only the first currently works:

http://localhost:8080/users - responds with a list of User resources
http://localhost:8080/users/1 - responds with a singleton resource
http://localhost:8080/users/2 - responds with a singleton resource
http://localhost:8080/users/3 - responds with a 404 and error payload

It looks like the correct endpoints are:

http://localhost:8080/users - responds with a list of User resources
http://localhost:8080/users/1/simple - responds with a singleton resource
http://localhost:8080/users/1/full - responds with a singleton resource
http://localhost:8080/users/2/simple - responds with a singleton resource
http://localhost:8080/users/2/full - responds with a singleton resource
http://localhost:8080/users/3/simple - responds with a 404 and error payload
http://localhost:8080/users/3/full - responds with a 404 and error payload

Alternatively, to make the originally stated endpoints available, the following endpoint can be added to the API type in example/src/Lib.hs:

:<|> "users" :> Capture "id" Int :> Get '[JSON] (Document User)

Along with a matching handler on the Server in the same file:

:<|> Controller.userShowSimple   -- or userShowFull

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions