Creating a Product definition file

You define a Product by creating a Product definition file.

About this task

You can create a Product definition file in either of the following ways:
  • Create the file in an editor of your choice.
  • Create a Product definition file by using the apic create --type product command and then modify it. You can base your Product definition file on the default Product template or on your own custom template.
This topic describes the syntax that is needed for both options and also the structure needed when the file is created in the editor.

You can create a Product in the CLI by running apic create --type product and adding additional arguments on the command line.. Another option is to create a Product interactively in the command line by running apic create --type product and following the prompts.

You can see further details and available options for the apic create --type product command by entering the command:
apic create --type product --help
[V5.0.2 or later]You can also create a Product from a custom Handlebars template by using the following command:
apic create --type product --template template_filename --title product_title
where template_filename is the name of the Handlebars template to use, and product_title is the title of your Product. A Product template file must have a .hbs file name extension. You can create a template from scratch, or start with the example (default) Product template provided in API and Product definition template examples.
[V5.0.2 or later]Instead of supplying the --template option, you can set the following configuration variables:
  • template-default-product - specifies the base file name of the .hbs template file.
  • template-path - specifies the directory containing the template file.
[V5.0.2 or later]For more information, see Creating and using API and Product definitions templates.

A Product definition file contains the following sections:

  • A specification version
  • An information section
  • A visibility section
  • An APIs section
  • A Plans section

In this topic, YAML is used, but the instructions can be adapted to use JSON. Both .yaml and .yml file extensions are supported, but the use of the .yaml file extension is recommended by yaml.org.

Note: All keys and enumeration values that are specified in this topic are case-sensitive.

Procedure

Structure your Product definition file by completing the following steps:

  1. Set the specification version by adding the following line to the beginning of the file: product: 1.0.0
    Note: The specification version is distinct from your Product version. The specification version refers to this YAML file, while the Product version is by your discretion.
  2. Include an information section with details about the Product, as described in Completing the information section of your Product description.
  3. Include a visibility section that specifies who can view and subscribe to the Product, as described in Specifying the visibility of your Product.
  4. Include an APIs section that references the APIs to be included in the Product, as described in Referencing the APIs for your Product.
  5. Include a Plans section that described the Plans you want include in your Product, as described in Describing Plans in your Product.

Results

You have completed a YAML representation of your Product. A complete example with full indentation can be found in An example YAML representation of a Product.

[V5.0.7 or later]From IBM API Connect Version 5.0.7.2, you can create multilingual API and Product documentation by using an x-ibm-languages extension directly in the OpenAPI (Swagger 2.0) definition. For more information, see Using x-ibm-languages to create multilingual API and Product documentation.