Editing a content definition
A content definition describes the content of an API request, response, or parameter. You can edit content definitions that have been previously created in various places in your API definition.
Before you begin
About this task
- This task relates to configuring an OpenAPI 3.0 API definition. For details on how to configure an OpenAPI 2.0 API definition, see Editing an OpenAPI 2.0 API definition.
- OpenAPI 3.0 APIs are supported only with the DataPower® API Gateway, not with the DataPower Gateway (v5 compatible).
- For details of current OpenAPI 3.0 support limitations, see OpenAPI 3.0 support in IBM® API Connect.
You can complete this task either by using the API Designer UI application, or by using the browser based API Manager UI.
At any time, you can switch directly to the underlying OpenAPI YAML source that corresponds to the design form in the user interface by clicking the Source icon . To return to the design form, click the Form icon .
Provide the following information:
- Content Type: Select the content type; for example,
application/json.Note: While the Content Type field in the editor provides a selection list of media types, by editing the OpenAPI source for the API directly you can specify a media type range; for example,
*/*. For requests or responses that match multiple types, only the most specific type is applicable;. for example,
To define a schema for the content definition, click Create, then refer to Creating a schema.
If the content definition already has a schema defined, click View to edit the schema.For full details on editing a schema, see Editing a schema.Note: You cannot edit the schema if it references a schema component, the schema configuration is inherited from the schema component; for details on configuring a schema component, see Defining schema components. You can, however, edit the referenced schema component but any changes will be reflected anywhere that the schema component is referenced.
- Example Value: An example of a parameter value. Whatever you enter here is displayed as-is in the Developer Portal.
To add an example of the content, click Add, then refer to Creating an example.
To edit an existing example, click the example name, then refer to Editing an example.
- Encoding: An encoding definition describes how a specific schema property
To add an encoding definition, click Add, then refer to Creating an encoding definition.
To edit an existing encoding definition, click the name, then refer to Editing an encoding definition.
- Content Type: Select the content type; for example, application/json.
- Click Save when done.