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

Index-less json parsing #96

Merged
merged 4 commits into from
Jun 28, 2024
Merged

Index-less json parsing #96

merged 4 commits into from
Jun 28, 2024

Conversation

HLWeil
Copy link
Member

@HLWeil HLWeil commented Jun 28, 2024

#95

Json writers now contain a noNumbering flag, which skips indexes when writing:

open FsSpreadsheet
open FsSpreadsheet.Net

let wb = new FsWorkbook()
let ws = FsWorkbook.initWorksheet "MySheet" wb
let r1 = ws.Row(1)
r1.[1].SetValueAs "A1"
r1.[2].SetValueAs "B1"
let r2 = ws.Row(2)
r2.[1].SetValueAs "A2"
r2.[2].SetValueAs "B2"

wb.ToRowsJsonString(noNumbering = true)

->

{
  "sheets": [
    {
      "name": "MySheet",
      "rows": [
        {
          "cells": [
            {
              "value": "A1"
            },
            {
              "value": "B1"
            }
          ]
        },
        {
          "cells": [
            {
              "value": "A2"
            },
            {
              "value": "B2"
            }
          ]
        }
      ]
    }
  ]
}

@HLWeil HLWeil merged commit ecd768c into main Jun 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants