Skip to content

Commit 0e2123c

Browse files
authored
[OPIK-1018] add OpenAPI spec for the projectName field of Span (#1678)
* OPIK-1018 add OpenAPI spec for the projectName field of Span * OPIK-1018 minor fix
1 parent 666bfca commit 0e2123c

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

apps/opik-documentation/documentation/fern/openapi/opik.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -6707,6 +6707,10 @@ components:
67076707
id:
67086708
type: string
67096709
format: uuid
6710+
project_name:
6711+
pattern: (?s)^\s*(\S.*\S|\S)\s*$
6712+
type: string
6713+
description: "If null, the default project is used"
67106714
project_id:
67116715
type: string
67126716
format: uuid

sdks/code_generation/fern/openapi/openapi.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -6707,6 +6707,10 @@ components:
67076707
id:
67086708
type: string
67096709
format: uuid
6710+
project_name:
6711+
pattern: (?s)^\s*(\S.*\S|\S)\s*$
6712+
type: string
6713+
description: "If null, the default project is used"
67106714
project_id:
67116715
type: string
67126716
format: uuid

sdks/python/src/opik/rest_api/types/span_public.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@
22

33
from ..core.pydantic_utilities import UniversalBaseModel
44
import typing
5+
import pydantic
56
from .span_public_type import SpanPublicType
67
import datetime as dt
78
from .json_node_public import JsonNodePublic
89
from .error_info_public import ErrorInfoPublic
910
from .feedback_score_public import FeedbackScorePublic
1011
from .comment_public import CommentPublic
11-
import pydantic
1212
from ..core.pydantic_utilities import IS_PYDANTIC_V2
1313

1414

1515
class SpanPublic(UniversalBaseModel):
1616
id: typing.Optional[str] = None
17+
project_name: typing.Optional[str] = pydantic.Field(default=None)
18+
"""
19+
If null, the default project is used
20+
"""
21+
1722
project_id: typing.Optional[str] = None
1823
trace_id: str
1924
parent_span_id: typing.Optional[str] = None

sdks/typescript/src/opik/rest_api/api/types/SpanPublic.ts

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import * as OpikApi from "../index";
66

77
export interface SpanPublic {
88
id?: string;
9+
/** If null, the default project is used */
10+
projectName?: string;
911
projectId?: string;
1012
traceId: string;
1113
parentSpanId?: string;

sdks/typescript/src/opik/rest_api/serialization/types/SpanPublic.ts

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { CommentPublic } from "./CommentPublic";
1414
export const SpanPublic: core.serialization.ObjectSchema<serializers.SpanPublic.Raw, OpikApi.SpanPublic> =
1515
core.serialization.object({
1616
id: core.serialization.string().optional(),
17+
projectName: core.serialization.property("project_name", core.serialization.string().optional()),
1718
projectId: core.serialization.property("project_id", core.serialization.string().optional()),
1819
traceId: core.serialization.property("trace_id", core.serialization.string()),
1920
parentSpanId: core.serialization.property("parent_span_id", core.serialization.string().optional()),
@@ -49,6 +50,7 @@ export const SpanPublic: core.serialization.ObjectSchema<serializers.SpanPublic.
4950
export declare namespace SpanPublic {
5051
export interface Raw {
5152
id?: string | null;
53+
project_name?: string | null;
5254
project_id?: string | null;
5355
trace_id: string;
5456
parent_span_id?: string | null;

0 commit comments

Comments
 (0)