File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -117,21 +117,19 @@ component name="OpenAPIDocument" accessors="true" {
117117 * Helper function to locate deeply nested document items
118118 *
119119 * @param key the key to locate
120- * @return any the value of the key or null if the key is not found
120+ * @return any the value of the key or a `$ref` object if the key is not found
121121 * @usage locate('key.subkey.subsubkey.waydowndeepsubkey')
122122 **/
123123 any function locate ( string key ){
124124 var rootDocument = this .getRootDocument ();
125125
126126 if ( structKeyExists ( rootDocument , arguments .key ) ){
127127 return rootDocument [ arguments .key ];
128- } else {
129- if ( isDefined ( ' rootDocument.#arguments .key #' ) ){
128+ } else if ( isDefined ( ' rootDocument.#arguments .key #' ) ){
130129 return evaluate ( ' rootDocument.#arguments .key #' );
131- }
130+ } else {
131+ return { " $ref" : " ## /#arrayToList ( listToArray ( arguments .key , " ." ), " /" ) #" };
132132 }
133-
134- return getDocument ();
135133 }
136134
137135 /* *******************************************************************************/
You can’t perform that action at this time.
0 commit comments