Referring to an extension in an API definition
To refer to an OpenAPI extension in your API definition YAML (or JSON) file, add an extensions
key under x-ibm-configuration
.
Before you begin
About this task
The following example shows an extension definition file that defines a bank branch, in YAML
format:
extension: '1.0.0'
info:
title: Banking services
name: banking
version: 1.0.0
description: Banking extensions
contact:
name: IBM API Connect
url: https://apiconnect.ibm.com/
email: myname@ibm.com
portal-visible: true
properties:
title: "Branch"
type: "object"
properties:
Branch type:
type: "string"
enum:
- "ATM"
- "Walk in"
location:
type: "object"
title: "Location"
properties:
city:
type: "string"
default: "San Francisco"
state:
type: "string"
default: "CA"
citystate:
type: "string"
description: "This is generated automatically from the previous two fields"
template: "{{city}}, {{state}}"
watch:
city: "location.city"
state: "location.state"
required:
- Branch type