The resolve configuration provides options for how URLs in API descriptions are handled.
If a URL is not publicly accessible, use these configuration settings to add the needed details to gain access.
{% admonition type="info" %} One HTTP header is supported for each URL resolved. {% /admonition %}
{% table %}
- Option
- Type
- Description
- doNotResolveExamples
- boolean
- Set this option to
trueto prevent resolving$reffields in singularexampleproperties. This affects bothlintandbundlecommands. Resolving$refs in other parts of the API description is unaffected.
- http
- HTTP object
- Describe URL patterns and the corresponding headers to use when resolving references that point to them.
{% /table %}
{% table %}
- Option
- Type
- Description
- matches
- string
- REQUIRED. The URL pattern to match, for example
https://api.example.com/v2/**orhttps://example.com/*/test.yaml.
- name
- string
- REQUIRED. The header name, for example
Authorization.
- value
- string
- The value to send for the header. Only one of
valueorenvVariablecan be used;envVariableis recommended for any secrets.
- envVariable
- string
- The name of the environment variable that contains the value to send for the header. Only one of
valueorenvVariablecan be used;envVariableis recommended for any secrets.
{% /table %}
If you have multiple examples to resolve, you can describe multiple entries with patterns to match and headers to include. The following example shows two patterns, with the names of environment variables that contain the values to use.
resolve:
http:
headers:
- matches: https://api.example.com/v2/**
name: X-API-KEY
envVariable: SECRET_KEY
- matches: https://example.com/*/test.yaml
name: Authorization
envVariable: SECRET_AUTH
When the OpenAPI description references a URL that matches these patterns, it is resolved using the additional header specified.