@@ -126,7 +126,10 @@ def build_action_schemas
126126 end
127127
128128 response_data = action_data [ :response ]
129- if response_data && response_data [ :body ]
129+ if response_data &.dig ( :no_content )
130+ schema_name = zod_mapper . action_schema_name ( resource_name , action_name , 'Response' , parent_path : parent_path )
131+ schemas << "export const #{ schema_name } = z.never();"
132+ elsif response_data && response_data [ :body ]
130133 schemas << zod_mapper . build_action_response_body_schema ( resource_name , action_name , response_data [ :body ] , parent_path : parent_path )
131134 schemas << zod_mapper . build_action_response_schema ( resource_name , action_name , response_data , parent_path : parent_path )
132135 end
@@ -192,15 +195,19 @@ def build_typescript_types
192195 end
193196
194197 response_data = action_data [ :response ]
195- next unless response_data && response_data [ :body ]
196198
197- type_name = typescript_mapper . action_type_name ( resource_name , action_name , 'ResponseBody' , parent_path : parent_path )
198- code = typescript_mapper . build_action_response_body_type ( resource_name , action_name , response_data [ :body ] , parent_path : parent_path )
199- all_types << { name : type_name , code : code }
199+ if response_data &.dig ( :no_content )
200+ type_name = typescript_mapper . action_type_name ( resource_name , action_name , 'Response' , parent_path : parent_path )
201+ all_types << { name : type_name , code : "export type #{ type_name } = never;" }
202+ elsif response_data && response_data [ :body ]
203+ type_name = typescript_mapper . action_type_name ( resource_name , action_name , 'ResponseBody' , parent_path : parent_path )
204+ code = typescript_mapper . build_action_response_body_type ( resource_name , action_name , response_data [ :body ] , parent_path : parent_path )
205+ all_types << { name : type_name , code : code }
200206
201- type_name = typescript_mapper . action_type_name ( resource_name , action_name , 'Response' , parent_path : parent_path )
202- code = typescript_mapper . build_action_response_type ( resource_name , action_name , response_data , parent_path : parent_path )
203- all_types << { name : type_name , code : code }
207+ type_name = typescript_mapper . action_type_name ( resource_name , action_name , 'Response' , parent_path : parent_path )
208+ code = typescript_mapper . build_action_response_type ( resource_name , action_name , response_data , parent_path : parent_path )
209+ all_types << { name : type_name , code : code }
210+ end
204211 end
205212 end
206213
0 commit comments