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

"Wrong parameters" even with type-safe Eliom_parameter and Html5.F.a #45

Closed
smondet opened this issue Jan 10, 2014 · 0 comments · Fixed by #114
Closed

"Wrong parameters" even with type-safe Eliom_parameter and Html5.F.a #45

smondet opened this issue Jan 10, 2014 · 0 comments · Fixed by #114
Labels

Comments

@smondet
Copy link

smondet commented Jan 10, 2014

While using the “normal” way of defining services, I got into a wrong argument parsing case.

Starting from a fresh project made with eliom-destillery, and the following modifications:

let main_service =
  Eliom_service.service ~path:[]
    ~get_params:Eliom_parameter.(
      sum 
        (set string "strings")
        (opt (int "left" ** int "right"))
    ) ()

and

let () =
  Test_app.register
    ~service:main_service
    (fun params () ->
      Lwt.return
        (Eliom_tools.F.html
           ~title:"test"
           ~css:[["css";"test.css"]]
           Html5.F.(body [
             h2 [pcdata "Welcome from Eliom's destillery!"];
             a main_service [pcdata "link1"] 
               (Eliom_parameter.Inj1 ["bouh"; "bah"]);
             pcdata ", ";
             a main_service [pcdata "link2"] 
               (Eliom_parameter.Inj2 None);
             pcdata ", ";
             a main_service [pcdata "link3"] 
               (Eliom_parameter.Inj2 (Some (42, 42)));
           ])))

On the generated page the link3 is broken (goes to “Wrong Parameters”).

I'm using Eliom 3.0.3 from Opam (and OCaml 4.01.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants