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

fix: prevent JsonParsing errors in ReportDoc data class #16

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ data class ReportDoc(
@JsonProperty("_rev")
val rev: String,
val title: String,
val mode: String,
val aggregationDefinition: String,
val mode: String = "unknown",
val aggregationDefinition: String?,
val created: EditAtBy?,
val updated: EditAtBy?,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class DefaultReportingStorage(
id = it.id,
name = it.doc.title,
mode = it.doc.mode,
query = it.doc.aggregationDefinition,
query = it.doc.aggregationDefinition ?: "",
schema = ReportSchema(
fields = reportSchemaGenerator.getTableNamesByQuery(it.doc.aggregationDefinition)
fields = reportSchemaGenerator.getTableNamesByQuery(it.doc.aggregationDefinition ?: "")
)
)
}
Expand All @@ -68,10 +68,10 @@ class DefaultReportingStorage(
Report(
id = reportDoc.id,
name = reportDoc.title,
query = reportDoc.aggregationDefinition,
query = reportDoc.aggregationDefinition ?: "",
mode = reportDoc.mode,
schema = ReportSchema(
fields = reportSchemaGenerator.getTableNamesByQuery(reportDoc.aggregationDefinition)
fields = reportSchemaGenerator.getTableNamesByQuery(reportDoc.aggregationDefinition ?: "")
)
)
)
Expand Down
Loading