File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,8 +56,7 @@ import { Security } from "./security";
5656import { ezUploadBrand } from "./upload-schema" ;
5757import wellKnownHeaders from "./well-known-headers.json" ;
5858
59- export interface OpenAPIContext {
60- isResponse : boolean ;
59+ interface ReqResCommons {
6160 makeRef : (
6261 key : object ,
6362 subject : SchemaObject | ReferenceObject ,
@@ -67,6 +66,10 @@ export interface OpenAPIContext {
6766 method : Method ;
6867}
6968
69+ export interface OpenAPIContext extends ReqResCommons {
70+ isResponse : boolean ;
71+ }
72+
7073export type Depicter = (
7174 zodCtx : { zodSchema : $ZodType ; jsonSchema : JSONSchema . BaseSchema } ,
7275 oasCtx : OpenAPIContext ,
@@ -81,8 +84,6 @@ export type IsHeader = (
8184
8285export type BrandHandling = Record < string | symbol , Depicter > ;
8386
84- type ReqResCommons = Omit < OpenAPIContext , "isResponse" > ;
85-
8687const shortDescriptionLimit = 50 ;
8788const isoDateDocumentationUrl =
8889 "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString" ;
Original file line number Diff line number Diff line change @@ -34,18 +34,18 @@ import {
3434
3535describe ( "Documentation helpers" , ( ) => {
3636 const makeRefMock = vi . fn ( ) ;
37- const requestCtx = {
37+ const requestCtx : OpenAPIContext = {
3838 path : "/v1/user/:id" ,
3939 method : "get" ,
4040 isResponse : false ,
4141 makeRef : makeRefMock ,
42- } satisfies OpenAPIContext ;
43- const responseCtx = {
42+ } ;
43+ const responseCtx : OpenAPIContext = {
4444 path : "/v1/user/:id" ,
4545 method : "get" ,
4646 isResponse : true ,
4747 makeRef : makeRefMock ,
48- } satisfies OpenAPIContext ;
48+ } ;
4949
5050 beforeEach ( ( ) => {
5151 makeRefMock . mockClear ( ) ;
You can’t perform that action at this time.
0 commit comments