Skip to content

Commit 098da89

Browse files
author
Vishnu Govindaraj
committed
feat: Update ApiErrorResponse to inherit from JsonModel and modify get_spec return type
Signed-off-by: Vishnu Govindaraj <[email protected]>
1 parent 8209beb commit 098da89

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from nisystemlink.clients.core._api_error import ApiError
2+
from nisystemlink.clients.core._uplink._json_model import JsonModel
23

34

4-
class ApiErrorResponse:
5+
class ApiErrorResponse(JsonModel):
56
"""Represents an error response from the SystemLink API responses."""
67

78
error: ApiError

nisystemlink/clients/spec/_spec_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Implementation of SpecClient"""
22

3-
from typing import List, Optional
3+
from typing import List, Optional, Union
44

55
from nisystemlink.clients import core
66
from nisystemlink.clients.core._api_error_response import ApiErrorResponse
@@ -98,7 +98,7 @@ def query_specs(
9898
...
9999

100100
@get("specs/{id}")
101-
def get_spec(self, id: str) -> models.Specification | ApiErrorResponse:
101+
def get_spec(self, id: str) -> Union[models.Specification, ApiErrorResponse]:
102102
"""Retrieves a single spec by id.
103103
104104
Args:

0 commit comments

Comments
 (0)