refactor(zod-openapi): change the position of functions (#688)
parent
96b0fd6174
commit
0add2f5800
|
@ -259,17 +259,6 @@ export type OpenAPIObjectConfigure<E extends Env, P extends string> =
|
||||||
| OpenAPIObjectConfig
|
| OpenAPIObjectConfig
|
||||||
| ((context: Context<E, P>) => OpenAPIObjectConfig)
|
| ((context: Context<E, P>) => OpenAPIObjectConfig)
|
||||||
|
|
||||||
const isJSONContentType = (contentType: string) => {
|
|
||||||
return /^application\/([a-z-\.]+\+)?json/.test(contentType)
|
|
||||||
}
|
|
||||||
|
|
||||||
const isFormContentType = (contentType: string) => {
|
|
||||||
return (
|
|
||||||
contentType.startsWith('multipart/form-data') ||
|
|
||||||
contentType.startsWith('application/x-www-form-urlencoded')
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export class OpenAPIHono<
|
export class OpenAPIHono<
|
||||||
E extends Env = Env,
|
E extends Env = Env,
|
||||||
S extends Schema = {},
|
S extends Schema = {},
|
||||||
|
@ -593,3 +582,14 @@ function addBasePathToDocument(document: Record<string, any>, basePath: string)
|
||||||
paths: updatedPaths,
|
paths: updatedPaths,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isJSONContentType(contentType: string) {
|
||||||
|
return /^application\/([a-z-\.]+\+)?json/.test(contentType)
|
||||||
|
}
|
||||||
|
|
||||||
|
function isFormContentType(contentType: string) {
|
||||||
|
return (
|
||||||
|
contentType.startsWith('multipart/form-data') ||
|
||||||
|
contentType.startsWith('application/x-www-form-urlencoded')
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue