-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add validate_t #136
Add validate_t #136
Conversation
For compatibility with atdgen validation and untypable JSON. e.g. `type json <ocaml module="Yojson.Safe" t="t"> = abstract`
The type In fact, I feel like we should probably also remove |
Got it. I’m happy to remove |
I think in such case it would be more reasonable to define a module that wraps Yojson.Safe.t in your code and provides |
Agreed. This seems like a good opportunity to break this connection between the two libraries since it is really an atdgen concern. |
Closing this in favor of #136. Thanks @metanivek for pointing our attention to the fact that we have old left-over code that doesn't work, let's make 2.0.0 the best release we can. |
@Leonidas-from-XIV happy to help! |
Just had the same problem. Could you explain how to turn off the validation for the json type? Every combination I'm using turn out to be wrong with the code atdgen.2.2.1 generates. |
@MisterDA I missed your comment previously, but I came back to this the other day and realized it wasn't working. I made a PR that should fix this as of atdgen.2.9.1 release. 🎉 |
While experimenting with atdgen, I came across an edge case when trying validations and untypable JSON.
If I use the following, I get a build warning about deprecation of the
json
type.If I add an explicit type (
t="t"
) to address the warning, compilation fails withUnbound value Yojson.Safe.validate_t
, so this PR adds it. Since it appears that thejson
type is disappearing, I also madevalidate_json
an alias tovalidate_t
as the canonical definition.