@@ -25,10 +25,9 @@ describe('Status Quote Attribute Integration Test', () => {
2525 JSON . stringify ( quoteProperty , null , 2 )
2626 ) ;
2727
28- // Check that the quote property has a oneOf structure with both Quote and ShallowQuote
29- // Note: nullable handling for oneOf structures is handled differently than simple $ref
28+ // Check that the quote property has a oneOf structure with both Quote and ShallowQuote plus null
3029 if ( quoteProperty . oneOf ) {
31- // Check if it's directly oneOf with Quote and ShallowQuote
30+ // Check if it's directly oneOf with Quote and ShallowQuote plus null
3231 const refs = quoteProperty . oneOf
3332 . filter ( ( item : any ) => item . $ref )
3433 . map ( ( item : any ) => item . $ref ) ;
@@ -37,14 +36,17 @@ describe('Status Quote Attribute Integration Test', () => {
3736 const hasShallowQuote = refs . includes (
3837 '#/components/schemas/ShallowQuote'
3938 ) ;
39+ const hasNull = quoteProperty . oneOf . some (
40+ ( item : any ) => item . type === 'null'
41+ ) ;
4042
4143 expect ( hasQuote ) . toBe ( true ) ;
4244 expect ( hasShallowQuote ) . toBe ( true ) ;
45+ expect ( hasNull ) . toBe ( true ) ;
4346
44- console . log ( '✓ Found both Quote and ShallowQuote references in oneOf' ) ;
45-
46- // Note: The nullable handling for oneOf structures could be improved in the future
47- // but the main issue (missing ShallowQuote) is now fixed
47+ console . log (
48+ '✓ Found both Quote and ShallowQuote references plus null in oneOf'
49+ ) ;
4850 } else {
4951 // If there's a nested structure due to nullable handling, check it
5052 console . log ( 'Quote property structure:' , quoteProperty ) ;
@@ -54,9 +56,10 @@ describe('Status Quote Attribute Integration Test', () => {
5456 const jsonStr = JSON . stringify ( quoteProperty ) ;
5557 expect ( jsonStr ) . toContain ( '#/components/schemas/Quote' ) ;
5658 expect ( jsonStr ) . toContain ( '#/components/schemas/ShallowQuote' ) ;
59+ expect ( jsonStr ) . toContain ( '"type":"null"' ) ;
5760
5861 console . log (
59- '✓ Found both Quote and ShallowQuote references in the structure'
62+ '✓ Found both Quote and ShallowQuote references and null in the structure'
6063 ) ;
6164 }
6265 }
0 commit comments