Search Inside Your API Specification Dependencies
When you import your API specifications from Exchange or Maven as dependencies of your projects, those dependencies relocate from src/resources/api/
to a ZIP file in your project’s classpath. This change means that you can’t search for your API dependencies by using the File Search option in Studio. To enable you to search for specific text inside your API dependencies, Studio introduces the API Search feature.
You can access the API Search menu from the taskbar at the Anypoint Studio display, either by selecting Search > Search… or by pressing Ctrl+h
:
To search inside of your API specification dependencies:
-
Type the text that you want to search for, following these conventions:
-
Use
*
to search for any chain of characters in your search criteria.
For example,/*customer
matches both possible endpoints/customers
and/{customerId}
. -
Append
?
to search for any character after a specific pattern.
For example,/?customer
matches/{customerId}
but not/customers
because there must be a character between the search criteria that you defined between the?
literal. -
Use
\
to escape any of the reserved literals used in search patterns.
For example, if you want to search for strings containing*
,?
, or\
you must escape them:\*
,\?
, and\\
.
-
-
If you want to specify a specific name pattern for the files you want to search through, type the pattern in the File name patterns field, following these conventions:
-
Use
*
to search for any chain of characters in your search criteria.
For example,*.raml
searches in all file names that end with the.raml
extension. -
Use
?
to allow any character after a specific pattern.
For example,customer?1.raml
searches inside file such ascustomer01.raml
,customer11.raml
, orcustomer21.raml
. -
Use
!
to exclude certain filenames or patterns.
For example,!examples.raml
searches inside all files exceptexamples.raml
.
-
-
Click the Choose… button to filter per file type.
-
Select one of the following types of API specifications in your project:
-
API dependencies searches inside API specifications imported from Exchange or Maven.
-
Local API Files searches inside API specifications added from a local file or from Anypoint Design Center.
-
-
Click Search.
You can also search for all API specifications inside your open projects. You can select Navigate > Open API Resource in the taskbar at the Anypoint Studio display, or press Cmd+Shift+p
(MacOS) or Ctrl+Shift+P
(Windows/Linux):
-
Type the name of the API resource that you’re looking for:
Studio displays all possible matches for the API resource that you typed.
-
Select the resource you were looking for and click OK.