Skip to content

Commit 009ae30

Browse files
authored
[feat] Allow definition of keys in metadata section (#629)
1 parent 1f33f54 commit 009ae30

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

fixbackend/inventory/inventory_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def search_history(
245245
if after:
246246
params["after"] = utc_str(after)
247247
if change:
248-
params["change"] = ",".join(c.value for c in change)
248+
params["change"] = ",".join(change)
249249
return self._stream(
250250
"POST",
251251
f"/graph/{graph}/search/history/list",
@@ -468,7 +468,7 @@ async def model(
468468
# format options
469469
with_properties: bool = True,
470470
with_relatives: bool = True,
471-
with_metadata: bool = True,
471+
with_metadata: Union[bool, List[str]] = True,
472472
graph: str = DefaultGraph,
473473
) -> List[Json]:
474474
log.info(f"Get model with flat={flat}, with_bases={with_bases}, with_property_kinds={with_property_kinds}")
@@ -482,7 +482,7 @@ async def model(
482482
"aggregate_roots_only": json.dumps(aggregate_roots_only),
483483
"with_properties": json.dumps(with_properties),
484484
"with_relatives": json.dumps(with_relatives),
485-
"with_metadata": json.dumps(with_metadata),
485+
"with_metadata": ",".join(with_metadata) if isinstance(with_metadata, list) else json.dumps(with_metadata),
486486
}
487487
response = await self._request(
488488
"GET",

fixbackend/inventory/inventory_router.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1414
import logging
1515
from datetime import datetime, timedelta
16-
from typing import Annotated, List, Literal, Optional, AsyncIterator, Dict
16+
from typing import Annotated, List, Literal, Optional, AsyncIterator, Dict, Union
1717

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

0 commit comments

Comments
 (0)