Skip to main content
Version: Current

OpenAPI

Description

OpenAPI is a specification for machine-readable interface definition for describing, producing, consuming, and visualizing RESTful web services. Nussknacker can read definition of an OpenAPI interface and generate an enricher component for each operation defined in the interface (service) specification.

Nussknacker supports OpenAPI specification versions 2.x and 3.x (note: 2.x is considered deprecated).

Integration parameters

ParameterDescription -
Integration nameUnique name for the integration
Spec URLURL of the OpenAPI interface definition. It contains definition of the service you want to interact with.
Server URLThe URL of the service. If not specified, the URL of the service is taken from the OpenAPI interface definition.
API KeyAPI key that will be passed to the service via header, query parameter or cookie, as indicated in the OpenAPI interface definition

Additional info

Nussknacker applies following rules when mapping OpenAPI operations to enrichers:

  • Parameters (path, query of header) are used to define enricher parameters
  • If specification declares body parameter as object, we expand to parameter list
  • We expect operation to define 200/201 response, returned object is the one that is the result of enricher
  • We map 404 HTTP code to null value of enricher
  • We use externalDocs.url to extract documentation link

Table below describes data types that OpenAPI integration handles:

OpenAPI TypeOpenAPI FormatType in Nussknacker
booleanBoolean
stringString
stringdate-timeLocalDateTime
integerLong
integerint32Integer
integerint64Long
numberBigDecimal
numberdoubleDouble
numberfloatDouble
arrayarray
map/objectrecord

OpenAPI integration can handle schema references. However, we don't support recursive schemas at the moment. Recursive schema occurrences will be replaced with Unknown type.

For objects and maps we use properties to define structure. For arrays, we use items to define type of elements.