Skip to content

Commit

Permalink
feat(api): set facet keys, counts required
Browse files Browse the repository at this point in the history
In response schema for facets, set key, count
properties to "required" so they don't show up as
undefined in JSON schema.

Closes: #182
  • Loading branch information
koeaw committed Aug 22, 2024
1 parent 3cd653f commit a231d24
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions apis_ontology/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,14 @@ def get_paginated_response_schema(self, schema):
"items": {
"type": "object",
"properties": {
"key": {"type": "string"},
"count": {"type": "integer"},
"key": {
"type": "string",
"required": True,
},
"count": {
"type": "integer",
"required": True,
},
},
},
"example": [{"key": "eng", "count": 100}],
Expand All @@ -139,8 +145,14 @@ def get_paginated_response_schema(self, schema):
"items": {
"type": "object",
"properties": {
"key": {"type": "string"},
"count": {"type": "integer"},
"key": {
"type": "string",
"required": True,
},
"count": {
"type": "integer",
"required": True,
},
},
},
"example": [{"key": "Traum", "count": 3}],
Expand Down

0 comments on commit a231d24

Please sign in to comment.