Skip to content

Commit b7c5170

Browse files
authored
Merge pull request #21 from homestar9/patch-2
Normalize the document object if Parser so it can be extended
2 parents 086320a + e639fa4 commit b7c5170

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

models/OpenAPI/Parser.cfc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ component name="OpenAPIParser" accessors="true" {
219219
};
220220
objects.each( function( item, index ) {
221221
if ( isStruct( item ) ) {
222+
223+
// If `item` is an instance of Parser, we need to flattin it to a CFML struct
224+
if ( isInstanceOf( item, "Parser" ) ) {
225+
item = item.getNormalizedDocument();
226+
}
227+
222228
item.each( function( key, value ) {
223229

224230
if (
@@ -328,4 +334,4 @@ component name="OpenAPIParser" accessors="true" {
328334

329335
}
330336

331-
}
337+
}

0 commit comments

Comments
 (0)