ballerina/swagger package

Annotations

Name Attachement Points Data Type Description
ClientConfig service ClientInformation Annotation to configure client code generation
ClientEndpoint endpoint - Presence of this annotation will mark this endpoint to be used as a service endpoint for client generation
ResourceInfo resource ResourceInformation Annotation for additional swagger information of a ballerina resource
ServiceInfo service ServiceInformation Annotation for additional swagger information of a ballerina service

Records Summary

Record Description
ClientInformation Configuration elements for client code generation
Contact Model for Swagger contact information
DocumentationInformation Model for service documentation definition
Encoding Model for additional swagger content type definition
Example
Header
License Model for service licence information
ParameterInformation Model for keeping swagger parameter information
ResourceInformation Model for additional swagger resource definition
Response
Schema
SecurityRequirement Model for security requirement definition. This is most likely the oauth scopes
ServiceInformation Model for additional swagger information of a ballerina service
Tag Model for swagger service tag definition
requestBody Model for additional swagger request body details

public type ClientInformation

Configuration elements for client code generation

Field Name Data Type Default Value Description
generate boolean true generates client code if set to true

public type Contact

Model for Swagger contact information

Field Name Data Type Default Value Description
name string Contact name
email string Contact email
url string Contact web address/page

public type DocumentationInformation

Model for service documentation definition

Field Name Data Type Default Value Description
description string Documentation description
url string Documentation url

public type Encoding

Model for additional swagger content type definition

Field Name Data Type Default Value Description
headers ParameterInformation[] Additional information to be provided as headers
contentType string The Content-Type for encoding a specific property
style string
explode boolean Should property values of array or object generate separate parameters for each value of the array
allowReserved boolean Determines whether the parameter value SHOULD allow reserved characters

public type Example

Field Name Data Type Default Value Description
exampleType string
value string
Field Name Data Type Default Value Description
name string
description string
headerType string

public type License

Model for service licence information

Field Name Data Type Default Value Description
name string License name
url string License url

public type ParameterInformation

Model for keeping swagger parameter information

Field Name Data Type Default Value Description
inInfo string Where the parameter is located. Ex: query
name string parameter name
description string Description of the parameter
required boolean Is this paramter MUST be present in the request
discontinued boolean Is this parameter deprecated
allowEmptyValue string is empty values allowed for this parameter. Valid only for query parameters
schema Schema Parameter data type

public type ResourceInformation

Model for additional swagger resource definition

Field Name Data Type Default Value Description
tags string[] Tags attched to this resource
summary string A short summary of what the operation does.
description string A verbose explanation of the operation behavior
externalDocs DocumentationInformation Additional documentation for this operation
parameters ParameterInformation[] A list of parameters that are applicable for this operation

public type Response

Field Name Data Type Default Value Description
code string
description string
response string
headers Header[]
examples Example[]

public type Schema

Field Name Data Type Default Value Description
itemType string
format string
isArray boolean
ref string
items string

public type SecurityRequirement

Model for security requirement definition. This is most likely the oauth scopes

Field Name Data Type Default Value Description
name string Security scheme name
requirements string[] Array of security requirements

public type ServiceInformation

Model for additional swagger information of a ballerina service

Field Name Data Type Default Value Description
title string Title of the swagger definition
serviceVersion string Version of the swagger API
description string
termsOfService string Service usage terms and conditions
contact Contact Contact information for the exposed API.
license License License information for the exposed API.
externalDocs DocumentationInformation
tags Tag[] A list of tags used by the specification with additional metadata
security SecurityRequirement[]

public type Tag

Model for swagger service tag definition

Field Name Data Type Default Value Description
name string Tag name
description string Tag decription
externalDocs DocumentationInformation Optional documentation on the tag

public type requestBody

Model for additional swagger request body details

Field Name Data Type Default Value Description
description string A brief description of the request body
required boolean Determines if the request body is required in the request
example string Example of the request body media type
examples Example[] Examples of the media type
schema Schema The schema defining the type used for the request body
encoding Encoding[] Encoding and content type details