Skip to content

Commit

Permalink
fix service name missing in ppx
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtori committed Oct 22, 2024
1 parent aede5f0 commit 95c2b71
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ppx/ppx_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,12 @@ let service_expr ?name ?options ?(parse_options=true) ~meth ~loc p =
match name with
| None -> Location.raise_errorf ~loc "service doesn't have a name"
| Some name ->
let options_name = match options.name.pexp_desc with
| Pexp_construct ({txt=Lident "None"; _}, _) -> [%expr Some [%e estring ~loc name]]
| _ -> options.name in
let expr = pexp_apply ~loc (evar ~loc "EzAPI.raw_service") [
Optional "section", options.section;
Optional "name", options.name;
Optional "name", options_name;
Optional "descr", options.descr;
Optional "params", options.params;
Labelled "meth", meth;
Expand Down

0 comments on commit 95c2b71

Please sign in to comment.