Real-world API specs aren’t perfect. Some declare authentication incorrectly, others have vague descriptions, and some have outdated server URLs. Overrides let you fix these issues without modifying the original spec.
The most common problem: 60% of real-world APIs declare authentication as header parameters instead of proper security schemes.
# What many specs do (problematic):parameters: - name: Authorization in: header required: true
# What they should do:components: securitySchemes: bearerAuth: type: http scheme: bearerWhen authentication is declared as a parameter, Toolcog can’t:
Overrides fix this by converting parameter-based auth to proper security schemes.
Overrides can apply at different levels:
Apply to all operations in a catalog:
Scope: All operationsOverride: Normalize Authorization headers to bearer tokensApply to operations from a specific API:
Scope: All Stripe operationsOverride: Use custom server URLApply to specific operations:
Scope: github/repos.createOverride: Mark as deprecatedMore specific scopes override broader ones.
Define OAuth2 authentication for an API:
type: oauthschemeName: oauth2grantType: authorization_codeauthorizationUrl: https://github.com/login/oauth/authorizetokenUrl: https://github.com/login/oauth/access_tokenscopes: - repo - userrealm: toolcog/githubDefine bearer token authentication:
type: bearerschemeName: bearerAuthnormalizeHeaders: true # Convert Authorization header paramDefine API key authentication:
type: apikeyschemeName: apiKeyin: headername: X-API-KeynormalizeHeaders: trueDefine HTTP Basic authentication:
type: basicschemeName: basicAuthnormalizeHeaders: trueReplace an operation’s description:
type: descriptionvalue: | Creates a new customer in your Stripe account.
The customer object represents a customer of your business. Use this to store contact information and payment methods.Replace an operation’s summary (the short one-liner):
type: summaryvalue: Create a new customerChange the base URL for API calls:
type: serverurl: https://api.example.com/v2Useful for:
Mark an operation as deprecated:
type: deprecatedvalue: trueRemove examples or extensions from specs:
type: stripexamples: true # Remove example valuesextensions: true # Remove x-* extensionsUseful for reducing spec size or removing sensitive examples.
Modify a parameter’s properties:
type: parametername: customer_iddescription: The unique identifier for the customerrequired: trueControl when overrides apply:
Override regardless of what the spec says:
strategy: alwaysOverride only if the spec doesn’t define it:
strategy: when-missingOverride only if no security scheme is declared:
strategy: when-undeclaredToolcog automatically applies some normalizations:
If a spec has:
parameters: - name: Authorization in: headerToolcog automatically:
You can disable this with explicit overrides if needed.
When multiple overrides could apply:
Earlier overrides take precedence.
scope: myapi/*type: bearerschemeName: bearerAuthnormalizeHeaders: truerealm: myorg/myapi-realmscope: github/*type: oauthschemeName: github_oauthgrantType: authorization_codeauthorizationUrl: https://github.com/login/oauth/authorizetokenUrl: https://github.com/login/oauth/access_tokenrealm: toolcog/githubscope: myapi/*type: serverurl: https://staging-api.example.comscope: stripe/customers.createtype: descriptionvalue: | Creates a new customer in Stripe with the provided details. Returns the created customer object including the generated ID.