Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated paths are not ordered correctly? #18

Open
Juneezee opened this issue Jan 14, 2022 · 0 comments
Open

Generated paths are not ordered correctly? #18

Juneezee opened this issue Jan 14, 2022 · 0 comments

Comments

@Juneezee
Copy link

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": {
               
            }
        }
    },
@Juneezee Juneezee changed the title Paths are not ordered correctly? Generated paths are not ordered correctly? Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant