Note: There is a newer version (2.3.2) of this package available. Click here to view docs for the latest version.
Ballerina library
openapi
Module openapi
ballerina/openapi Ballerina library
2.2.0
Annotations
openapi: Example
Annotation for an example value.
openapi: Examples
Annotation for a set of example values.
openapi: ResourceInfo
Annotation for additional OpenAPI information of a Ballerina resource function.
openapi: ServiceInfo
Annotation for additional OpenAPI information of a Ballerina service.
Records
openapi: Examples
Read OnlyClosed record
Represents examples for resource function.
Fields
- response? map<ResponseExample> - Response examples
- requestBody? RequestExamples - Request examples
openapi: ExampleValue
Read OnlyClosed record
Represents an example value.
Fields
- value anydata - The example value.
openapi: ExampleValues
Read Only
Represents a set of example values.
Fields
- ExampleValue... - Rest field
openapi: ResourceInformation
Closed record
This annotation represents a record for storing resource meta information.
Fields
- summary? string - A brief summary of the resource.
- tags? string[] - Tags associated with the resource.
- operationId? string - Unique identifier for the operation.
- examples? Examples - This section contains detailed examples for responses and request bodies.
openapi: ResponseExample
Closed record
Represents an example of a response for a specific status code.
Fields
openapi: ServiceInformation
Closed record
Service validation code.
Fields
- contract string(default "") - OpenAPI contract link
- tags string[]?(default []) - OpenAPI tags
- operations string[]?(default []) - OpenAPI operations
- excludeTags string[]?(default []) - Disable the OpenAPI validator for these tags
- excludeOperations string[]?(default []) - Disable the OpenAPI validator for these operations
- failOnErrors boolean(default true) - Enable the OpenAPI validator
- embed boolean(default false) - Enable auto-inject of OpenAPI documentation to current service
- title? string - Title for generated OpenAPI contract
- version? string - Version for generated OpenAPI contract
- description? string - A brief description of the API, outlining its purpose, features, and any other relevant details that help users understand what the API does and how to use it.
- email? string - The email address to contact the API provider or support.
- contactName? string - The full name of the person or organization responsible for the API.
- contactURL? string - The URL to a web page with more information about the API, the provider, or support.
- termsOfService? string - The URL to the terms of service for the API.
- licenseName? string - The name of the license under which the API is provided.
- licenseURL? string - The URL to the full text of the license.