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

Deriving Json: inline notation no longer supported? #918

Closed
vouillon opened this issue Nov 13, 2019 · 5 comments
Closed

Deriving Json: inline notation no longer supported? #918

vouillon opened this issue Nov 13, 2019 · 5 comments
Labels
bug

Comments

@vouillon
Copy link
Member

@vouillon vouillon commented Nov 13, 2019

Describe the bug
An expression [%derive.json: cookie_array] no longer compiles:

File "src/lib/eliom_cookies_base.shared.ml", line 21, characters 28-39:
Error: Deriver json does not support inline notation

Versions
This compiles with Js_of_ocaml 3.4 but not Js_of_ocaml 3.5

@vouillon vouillon added the bug label Nov 13, 2019
@hhugo

This comment has been minimized.

Copy link
Member

@hhugo hhugo commented Nov 13, 2019

I think the syntax changed a little when we switch to ppxlib (#809)

Try this syntax

[%json: cookie_array] 
@hhugo hhugo mentioned this issue Nov 13, 2019
4 of 4 tasks complete
@vouillon

This comment has been minimized.

Copy link
Member Author

@vouillon vouillon commented Nov 13, 2019

This seems to work, indeed, with the following changes:

before now
derive.json json
derive.to_json json_of
derive.of_json of_json
@hhugo

This comment has been minimized.

Copy link
Member

@hhugo hhugo commented Nov 16, 2019

I created #922 to document the syntax a bit.

It also include a change to allow [%to_json] in addition to [%json_of].
This should make the transition easier and also keep some symmetry with names generated from [@@deriving json]

@hhugo

This comment has been minimized.

Copy link
Member

@hhugo hhugo commented Nov 16, 2019

I've added some documentation for upgrading to 3.5
https://github.com/ocsigen/js_of_ocaml/wiki/Upgrade-from-3.4.0-to-3.5.0

@hhugo

This comment has been minimized.

Copy link
Member

@hhugo hhugo commented Nov 17, 2019

@hhugo hhugo closed this Nov 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.