Creating a Product definition file
You define a Product by creating a Product definition file.
About this task
- Create the file in an editor of your choice.
- Create a Product definition file by using the
apic create:product
command and then modify it. You can base your Product definition file on the default Product template or on your own custom template.
apic create:product
and supplying
additional arguments on the command line. For example, you can enter the following text in a single
command:
apic create:product --name product_name --title product_title --filename product_file_name.yaml
--apis "filename_of_api1.yaml filename_of_api2.yaml"
where: - product_name is the name for your new Product.
- product_title is the title of your new Product.
- product_file_name.yaml is the name of the yaml file that is created for your new Product.
- filename_of_api1.yaml is the file name of one of the APIs that is used within the new Product.
- filename_of_api2.yaml is the file name of one of the APIs that is used within the new Product.
apic
create:product
and following the prompts.apic create:product
command by entering the command: apic create:product --help
apic create: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.A Product definition file contains the following sections:
- The 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.
Procedure
Structure your Product definition file by completing the following steps:
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.
You can create multilingual API and Product documentation by using an
x-ibm-languages
extension directly in the OpenAPI definition. For more
information, see Using x-ibm-languages to create multilingual API and Product documentation.