File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export const zodSchemaAdapter: SchemaAdapter = {
4040 } ) ,
4141 ) ;
4242 } ,
43- getResponseContentType : ( schema : any ) => {
43+ getMeta : ( schema : any ) => {
4444 const meta = z . globalRegistry . get ( schema ) ;
4545 return meta ?. contentType ?? meta ?. [ "content-type" ] ;
4646 } ,
Original file line number Diff line number Diff line change @@ -62,10 +62,9 @@ export function buildOpenApiDocs(
6262 requestBody : body
6363 ? {
6464 content : {
65- [ adapter . getResponseContentType ( body ) ?? "application/json" ] :
66- {
67- schema : adapter . toJsonSchema ( body ) ,
68- } ,
65+ [ adapter . getMeta ( body ) ?. contentType ?? "application/json" ] : {
66+ schema : adapter . toJsonSchema ( body ) ,
67+ } ,
6968 } ,
7069 }
7170 : undefined ,
@@ -79,7 +78,7 @@ export function buildOpenApiDocs(
7978 200 : {
8079 description : "OK" ,
8180 content : {
82- [ adapter . getResponseContentType ( response ) ??
81+ [ adapter . getMeta ( response ) ?. contentType ??
8382 "application/json" ] : {
8483 schema : adapter . toJsonSchema ( response ) ,
8584 } ,
Original file line number Diff line number Diff line change @@ -956,7 +956,7 @@ export interface SchemaAdapter {
956956 schema : StandardSchemaV1 ;
957957 description ?: string ;
958958 } > ;
959- getResponseContentType : ( schema : StandardSchemaV1 ) => string | undefined ;
959+ getMeta : ( schema : StandardSchemaV1 ) => Record < string , any > | undefined ;
960960}
961961
962962//
You can’t perform that action at this time.
0 commit comments