File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -142,9 +142,9 @@ const Share = Schema.Struct({
142142 url : Schema . String ,
143143} )
144144
145- // Legacy HTTP accepted any number here, and persisted data may already contain
146- // negative values. Keep archive timestamps permissive while other clocks stay non-negative .
147- export const ArchivedTimestamp = Schema . Number
145+ // Legacy HTTP accepted negative values here. Keep archive timestamps permissive
146+ // while excluding non-finite values that cannot round-trip through JSON .
147+ export const ArchivedTimestamp = Schema . Finite
148148
149149const Time = Schema . Struct ( {
150150 created : NonNegativeInt ,
Original file line number Diff line number Diff line change @@ -258,6 +258,18 @@ describe("HttpApi server", () => {
258258 } )
259259 } )
260260
261+ test ( "matches SDK-affecting request schema details" , ( ) => {
262+ const effect = effectOpenApi ( )
263+ const sessionUpdate = effect . paths [ "/session/{sessionID}" ] ?. patch ?. requestBody
264+ const sessionUpdateSchema =
265+ typeof sessionUpdate === "object" && sessionUpdate && "content" in sessionUpdate
266+ ? sessionUpdate . content ?. [ "application/json" ] ?. schema
267+ : undefined
268+ const sessionUpdateProperties = sessionUpdateSchema ?. properties as Record < string , OpenApiSchema > | undefined
269+ const time = sessionUpdateProperties ?. time
270+ expect ( time ?. properties ?. archived ) . toEqual ( { type : "number" } )
271+ } )
272+
261273 test ( "documents event routes as server-sent events" , ( ) => {
262274 const effect = effectOpenApi ( )
263275
You can’t perform that action at this time.
0 commit comments