Skip to content

Generated paths are not ordered correctly? #18

Description

@Juneezee

Using the TodoAPI from Todo.hs,

type TodoAPI
    = "todo" :> Get '[JSON] [Todo]
 :<|> "todo" :> ReqBody '[JSON] Todo :> Post '[JSON] TodoId
 :<|> "todo" :> Capture "id" TodoId :> Get '[JSON] Todo
 :<|> "todo" :> Capture "id" TodoId :> ReqBody '[JSON] Todo :> Put '[JSON] TodoId

Expected

The generated JSON paths follows the ordering of TodoAPI: GET /todo is generated before POST /todo, and /todo is generated before /todo/{id}

    "paths": {
        "/todo": {
            "get": {
               
            }
            "post": {
                
            },
        }
        "/todo/{id}": {
            "get": {
             
            },
            "put": {

            }
        },
    },

Actual

The generated paths is ordered differently from the TodoAPI definition

    "paths": {
        "/todo/{id}": {
            "get": {
             
            },
            "put": {

            }
        },
        "/todo": {
            "post": {
                
            },
            "get": {
               
            }
        }
    },

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions