Skip to content

Commit

Permalink
[feat] Allow definition of keys in metadata section (#629)
Browse files Browse the repository at this point in the history
  • Loading branch information
aquamatthias authored Sep 30, 2024
1 parent 1f33f54 commit 009ae30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions fixbackend/inventory/inventory_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def search_history(
if after:
params["after"] = utc_str(after)
if change:
params["change"] = ",".join(c.value for c in change)
params["change"] = ",".join(change)
return self._stream(
"POST",
f"/graph/{graph}/search/history/list",
Expand Down Expand Up @@ -468,7 +468,7 @@ async def model(
# format options
with_properties: bool = True,
with_relatives: bool = True,
with_metadata: bool = True,
with_metadata: Union[bool, List[str]] = True,
graph: str = DefaultGraph,
) -> List[Json]:
log.info(f"Get model with flat={flat}, with_bases={with_bases}, with_property_kinds={with_property_kinds}")
Expand All @@ -482,7 +482,7 @@ async def model(
"aggregate_roots_only": json.dumps(aggregate_roots_only),
"with_properties": json.dumps(with_properties),
"with_relatives": json.dumps(with_relatives),
"with_metadata": json.dumps(with_metadata),
"with_metadata": ",".join(with_metadata) if isinstance(with_metadata, list) else json.dumps(with_metadata),
}
response = await self._request(
"GET",
Expand Down
4 changes: 2 additions & 2 deletions fixbackend/inventory/inventory_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
from datetime import datetime, timedelta
from typing import Annotated, List, Literal, Optional, AsyncIterator, Dict
from typing import Annotated, List, Literal, Optional, AsyncIterator, Dict, Union

from fastapi import APIRouter, Body, Depends, Form, Path, Query, Request
from fastapi.responses import JSONResponse, Response
Expand Down Expand Up @@ -174,7 +174,7 @@ async def model(
aggregate_roots_only: bool = Query(default=True, description="Include only aggregate roots."),
with_properties: bool = Query(default=True, description="Include properties."),
with_relatives: bool = Query(default=True, description="Include property kinds."),
with_metadata: bool = Query(default=True, description="Include property kinds."),
with_metadata: Union[bool, List[str]] = Query(default=True, description="Include property kinds."),
flat: bool = Query(default=True, description="Return a flat list of kinds."),
) -> List[Json]:
return await inventory().client.model(
Expand Down

0 comments on commit 009ae30

Please sign in to comment.