---
title: "saveJSON(to:includeReportMetadata:)"
framework: evaluations
role: symbol
role_heading: Instance Method
path: "evaluations/evaluationresult/savejson(to:includereportmetadata:)"
---

# saveJSON(to:includeReportMetadata:)

Saves evaluation results to a single JSON file.

## Declaration

```swift
@discardableResult func saveJSON(to directory: URL, includeReportMetadata: Bool = false) throws -> URL
```

## Parameters

- `directory`: The directory to save the file in.
- `includeReportMetadata`: Whether to include report metadata. Defaults to false.

## Return Value

Return Value The URL of the saved file

## Discussion

Discussion The file contains sections for summary, results, metadata, and optionally report metadata.

## See Also

### Saving and loading results

- [jsonData(includeReportMetadata:jsonOptions:)](evaluations/evaluationresult/jsondata(includereportmetadata:jsonoptions:).md)
- [loadJSON(from:)](evaluations/evaluationresult/loadjson(from:).md)
- [loadJSONLines(from:)](evaluations/evaluationresult/loadjsonlines(from:).md)
- [init(jsonData:)](evaluations/evaluationresult/init(jsondata:).md)
