Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/whiteblackgoose/json2fs
Tool which converts json from file into F# records
https://github.com/whiteblackgoose/json2fs
Last synced: about 1 month ago
JSON representation
Tool which converts json from file into F# records
- Host: GitHub
- URL: https://github.com/whiteblackgoose/json2fs
- Owner: WhiteBlackGoose
- Created: 2022-02-08T07:16:24.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-19T09:17:02.000Z (over 1 year ago)
- Last Synced: 2024-10-06T09:05:56.531Z (about 1 month ago)
- Language: F#
- Size: 19.5 KB
- Stars: 11
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# json2fs
Tool which converts json from file into F# records. There's also library Json2Fs.Core. Both can be found on nuget.org.
## Usage of Json2Fs
Get it from nuget:
```
dotnet tool install json2fs --global --prerelease
```Run it like this:
```
json2fs WebsiteResponse your/path/to.json dst.fs
```Where `WebsiteResponse` is the name of the root record (the one you will be deserializing into).
## Usage of Json2Fs.Core
```fs
open Json2Fs.Corelet json = ... // string
let jsonElement = JsonSerializer.Deserialize json
let dtos = generateFSharpDTOsByJson typename jsonElement // a list of records
let ``F# code`` = fsRecordsToString dtos // this converts it to the actual code
```