Skip to content

Commit

Permalink
Fix openapi.json (#2574)
Browse files Browse the repository at this point in the history
* add a description about #2573

* fix NumericalStatisticsItem

* fix anyOf, see https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/
  • Loading branch information
severo authored Mar 12, 2024
1 parent 84c5e3b commit 5650e46
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions docs/source/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,9 @@
}
}
},
"NullableNumber": {
"oneOf": [{ "type": "number" }, { "type": "null" }]
},
"NumericalStatisticsItem": {
"type": "object",
"required": [
Expand All @@ -1120,26 +1123,17 @@
"nan_proportion": {
"type": "number"
},
"min": {
"type": { "anyOf": [{ "type": "number" }, { "type": "null" }] }
},
"max": {
"type": { "anyOf": [{ "type": "number" }, { "type": "null" }] }
},
"mean": {
"type": { "anyOf": [{ "type": "number" }, { "type": "null" }] }
},
"median": {
"type": { "anyOf": [{ "type": "number" }, { "type": "null" }] }
},
"std": {
"type": { "anyOf": [{ "type": "number" }, { "type": "null" }] }
},
"histogram": { "anyOf": [{ "$ref": "#/components/schemas/Histogram" }, { "type": "null" }] }
"min": { "$ref": "#/components/schemas/NullableNumber" },
"max": { "$ref": "#/components/schemas/NullableNumber" },
"mean": { "$ref": "#/components/schemas/NullableNumber" },
"median": { "$ref": "#/components/schemas/NullableNumber" },
"std": { "$ref": "#/components/schemas/NullableNumber" },
"histogram": { "oneOf": [{ "$ref": "#/components/schemas/Histogram" }, { "type": "null" }] }
}
},
"CategoricalStatisticsItem": {
"type": "object",
"description": "note that fields 'no_label_count' and 'no_label_proportion' are not required, because some old entries still miss them, and we don't want to recompute all of them. See https://github.com/huggingface/datasets-server/issues/2573.",
"required": ["nan_count", "nan_proportion", "n_unique", "frequencies"],
"properties": {
"nan_count": {
Expand Down Expand Up @@ -1184,7 +1178,7 @@
}
},
"SupportedStatistics": {
"oneOf": [
"anyOf": [
{
"$ref": "#/components/schemas/NumericalStatisticsItem"
},
Expand Down

0 comments on commit 5650e46

Please sign in to comment.