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
Configuration elements for client code generation
Field Name |
Data Type |
Default Value |
Description |
generate |
boolean |
true |
generates client code if set to true |
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 |
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 |
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 |
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 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 |
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
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 |