Closed DimuthuMadushan closed 3 months ago
May I know the ballerina version you are using?
This works in the latest Ballerina version - Ballerina SwanLake Update 9(2201.9.2)
Generated OpenAPI specification:
openapi: 3.0.1
info:
title: Sample Openapi Yaml
version: 0.0.0
servers:
- url: "{server}:{port}/"
variables:
server:
default: http://localhost
port:
default: "9090"
paths:
/artist:
get:
operationId: getArtist
responses:
"200":
description: Ok
content:
text/plain:
schema:
type: string
"500":
description: InternalServerError
content:
application/json:
schema:
$ref: '#/components/schemas/ServerError'
components:
schemas:
ErrorPayload:
required:
- message
- method
- path
- reason
- status
- timestamp
type: object
properties:
timestamp:
type: string
status:
type: integer
format: int64
reason:
type: string
message:
type: string
path:
type: string
method:
type: string
ServerError:
$ref: '#/components/schemas/ErrorPayload'
@TharmiganK 2201.8.6
Closing this issue since this is already fixed in the latest version
Description: Consider the following http service.
The generated OpenAPI spec for the above service doesn't include the
ServerError
type.However it returns the following warning while generating the spec.