Designer 10.7 | webMethods Service Development Help | Working with REST API Descriptors | Swagger-Based Provider REST API Descriptors | Mapping Integration Server Content Type Constraints to Swagger Type Constraints
 
Mapping Integration Server Content Type Constraints to Swagger Type Constraints
When variables, defined in a mapped REST service of a REST V2 resource, contain content type constraints, then Integration Server converts and adds the applicable constraints to the generated Swagger document while creating the RAD.
The following table shows how Integration Server converts the content type constraints and adds them to the Swagger document as Swagger type constraints.
Integration Server Content Type Constraints
Swagger Type Constraints
enumeration
enum
length
minLength
maxLength
minLength
minLength
maxLength
maxLength
pattern
pattern
minInclusive
minimum
exclusiveMinimum
minExclusive
Same as above
maxInclusive
maximum
exclusiveMaximum
maxExclusive
Same as above
totalDigits
NA
fractionDigits
NA
whitespace
NA
Note:
The content type of a variable can have multiple values for pattern constraint, however, Integration Server sets the first value as a pattern in the generated Swagger document according to the Swagger specification.
The following table shows the mapping between the Integration Server content type, Swagger data type, and Swagger constraints.
IS Content Type
Swagger Data Type
Format
Swagger Constraints
byte
integer
int32
enum, minimum, exclusiveMinimum, maximum, exclusiveMaximum, pattern
short
integer
int32
Same as above
int
integer
int32
Same as above
long
integer
int64
Same as above
double
number
double
Same as above
float
number
float
Same as above
integer
integer
Same as above
nonPositiveInteger
integer
Same as above
negativeInteger
integer
Same as above
nonNegativeInteger
integer
Same as above
unsignedByte
integer
Same as above
unsignedShort
integer
Same as above
unsignedInt
integer
Same as above
unsignedLong
integer
Same as above
positiveInteger
integer
Same as above
duration, gDay, gMonth, gMonthDay, gYear, gYearMonth, time
string
Same as above
base64Binary
string
byte
enum, minLength, maxLength, pattern
hexBinary
string
binary
Same as above
string, anyURI, ENTITY, ID, IDREF, language, Name, NCName, NMTOKEN, token, normalizedString
string
Same as above
ENTITIES, IDREFS, NMTOKENS
string
enum, minLength, maxLength,
decimal
number
enum, pattern
dateTime
string
date-time
Same as above
date
string
date
Same as above
boolean
boolean
pattern