-
Notifications
You must be signed in to change notification settings - Fork 39
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
FSharp.Data.Toolbox.dll requires sample json files #1
Comments
tpetricek
added a commit
to tpetricek/FSharp.Data
that referenced
this issue
Apr 28, 2014
This was triggered by the issue in Twitter: fsprojects/FSharp.Data.Toolbox#1 The problem is that `FSharp.Data.Toolbox.Twitter.dll` exposes the types generated by the JSON type provider to the caller - so the methods in the Twitter API return types generated by the type provider from sample JSON files (I think this is reasonable - if we had to re-write all the type declarations by hand, then this would be hard work). The problem is that the samples are in a local folder (`json/foo.json`) and when you build `FSharp.Data.Toolbox.Twitter.dll`, you do not want to always keep them around (because referencing the Twitter API will trigger the type provider and the type provider will be looking for them). Embedding the samples inline also does not work - they are just too long and the F# compiler cannot deal with them. With this change, we can say `JsonProvider<"sample.json", EmbeddedResource="MyLib,sample.json">`. The type provider will first try to load `MyLib` and find the resource there (so, when you are referencing compiled `FSharp.Data.Toolbox.Twitter.dll`, it will find the resource there). If this fails, it falls back to standard directory search (which handles the case when you are compiling `FSharp.Data.Toolbox.Twitter.dll` itself). I'm not entirely happy with this solution (feels a bit hacky), but I do not think that there is any other way - aside from making the type providers generative, which would be nice thing to do, but AFAIK not something that'll happen very soon.
Fixed in #6 |
arestenko
referenced
this issue
in arestenko/FSharp.Data.Toolbox
Oct 3, 2015
tpetricek
pushed a commit
that referenced
this issue
May 9, 2016
Bugfix: exception when date is encoded with less than 8 bytes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiled assembly using JSON provider (FSharp.Data.Toolbox.Twitter.dll) requires sample json files. Can we modify the project so that the files are not needed when using the Twitter provider?
The text was updated successfully, but these errors were encountered: