Skip to content

Service contracts

The openapi and wsdl outputs generate contracts only, without an OSB project. They are useful to agree an interface before it is implemented, to publish it in an API gateway, or to hand it to a consumer team.

Each exposed service in the plan gets its own document, built from the operations assigned to it. An operation exposed by several services appears in each of their contracts.

OpenAPI

{Project}/{Service}.openapi.json, OpenAPI 3.0.3:

  • one path per operation, with its HTTP method, path parameters, query parameters and header parameters (constraints, enumerations and descriptions included);
  • request bodies and responses as component schemas, with nested and repeating structures, nullable, required and value constraints;
  • an example value for every schema, derived from its type and constraints;
  • info.version is always set, so tools such as IBM API Connect import the document without changes.

OSB projects with a REST exposed service also get an OpenAPI specification of that service, with its server URL and security schemes; see Documentation and test artifacts.

WSDL and XSD

{Project}/{Service}.wsdl and {Project}/{Service}.xsd:

  • document/literal binding for SOAP 1.1 or 1.2 (soap_version in the plan, or the version of the source WSDL);
  • one message pair per operation, with elements defined in the XSD of the same name;
  • the XSD sits next to the WSDL (schemaLocation="{Service}.xsd").

The standalone WSDL has no fault messages, because it does not depend on the OSB CommonSchema.xsd.

From one format to another

Source Target Notes
WADL + XSD OpenAPI Request and response structures come from the XSD elements the WADL references
WSDL + XSD OpenAPI Each SOAP operation becomes a POST /{Operation}
OpenAPI WSDL + XSD JSON schemas become XSD complex types; arrays become repeating elements