@@ -322,14 +322,16 @@ describe('Generated OpenAPI Specification', () => {
322322 it ( 'should have proper descriptions for all components' , ( ) => {
323323 Object . values ( openapiSpec . paths ) . forEach ( ( pathSpec : unknown ) => {
324324 const spec = pathSpec as Record < string , unknown > ;
325+ const pathSpec = spec as { post : { summary : string } } ;
325326 expect ( pathSpec . post . summary ) . toBeTruthy ( ) ;
326327 expect ( pathSpec . post . summary . length ) . toBeGreaterThan ( 0 ) ;
327328 } ) ;
328329
329330 Object . entries ( openapiSpec . components . schemas ) . forEach (
330331 ( [ schemaName , schema ] : [ string , unknown ] ) => {
331332 const schemaObj = schema as Record < string , unknown > ;
332- Object . entries ( schema . properties ) . forEach ( ( [ propName , property ] : [ string , any ] ) => {
333+ const schemaWithProps = schemaObj as { properties : Record < string , { description ?: string } > } ;
334+ Object . entries ( schemaWithProps . properties ) . forEach ( ( [ propName , property ] ) => {
333335 if ( property . description ) {
334336 expect ( property . description . length ) . toBeGreaterThan ( 0 ) ;
335337 expect ( property . description . trim ( ) ) . toBe ( property . description ) ;
@@ -372,7 +374,25 @@ describe('Generated OpenAPI Specification', () => {
372374 // Collect all $ref references
373375 Object . values ( openapiSpec . paths ) . forEach ( ( pathSpec : unknown ) => {
374376 const spec = pathSpec as Record < string , unknown > ;
375- const post = pathSpec . post ;
377+ const postSpec = spec as {
378+ post : {
379+ requestBody ?: {
380+ content ?: {
381+ 'application/json' ?: {
382+ schema ?: { $ref ?: string }
383+ }
384+ }
385+ } ;
386+ responses : Record < string , {
387+ content ?: {
388+ 'application/json' ?: {
389+ schema ?: { $ref ?: string }
390+ }
391+ }
392+ } > ;
393+ }
394+ } ;
395+ const post = postSpec . post ;
376396
377397 // Request body schema
378398 if ( post . requestBody ?. content ?. [ 'application/json' ] ?. schema ?. $ref ) {
@@ -382,7 +402,7 @@ describe('Generated OpenAPI Specification', () => {
382402 }
383403
384404 // Response schemas
385- Object . values ( post . responses ) . forEach ( ( response : any ) => {
405+ Object . values ( post . responses ) . forEach ( ( response ) => {
386406 if ( response . content ?. [ 'application/json' ] ?. schema ?. $ref ) {
387407 const ref = response . content [ 'application/json' ] . schema . $ref ;
388408 const schemaName = ref . replace ( '#/components/schemas/' , '' ) ;
0 commit comments