-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #865 from lnash94/beta_6_choreo
[BallerinaToOpenAPI][Beta6] Fix cyclic record resolving issue
- Loading branch information
Showing
4 changed files
with
112 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
openapi-cli/src/test/resources/ballerina-to-openapi/expected_gen/record/cyclic_record.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
openapi: 3.0.1 | ||
info: | ||
title: PayloadV | ||
version: 0.0.0 | ||
servers: | ||
- url: "{server}:{port}/payloadV" | ||
variables: | ||
server: | ||
default: petstore.swagger.io | ||
port: | ||
default: "443" | ||
paths: | ||
/pet: | ||
post: | ||
operationId: operation_post_/pet | ||
responses: | ||
"200": | ||
description: Ok | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/ResponseError' | ||
"202": | ||
description: Accepted | ||
/pet02: | ||
post: | ||
operationId: operation_post_/pet02 | ||
responses: | ||
"200": | ||
description: Ok | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/ResponseError02' | ||
"202": | ||
description: Accepted | ||
components: | ||
schemas: | ||
ResponseError: | ||
required: | ||
- id | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
format: int32 | ||
nullable: true | ||
resError: | ||
$ref: '#/components/schemas/ResponseError' | ||
ResponseError02: | ||
required: | ||
- id | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
format: int32 | ||
nullable: true | ||
resError: | ||
oneOf: | ||
- $ref: '#/components/schemas/ResponseError02' | ||
- type: string |
24 changes: 24 additions & 0 deletions
24
openapi-cli/src/test/resources/ballerina-to-openapi/record/cyclic_record.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import ballerina/http; | ||
|
||
type ResponseError record {| | ||
int? id; | ||
ResponseError resError?; | ||
|}; | ||
|
||
type ResponseError02 record {| | ||
int? id; | ||
ResponseError02|string resError?; | ||
|}; | ||
|
||
listener http:Listener ep0 = new (443, config = {host: "petstore.swagger.io"}); | ||
|
||
service /payloadV on ep0 { | ||
resource function post pet() returns ResponseError|http:Accepted { | ||
http:Accepted accept = {body: ()}; | ||
return accept; | ||
} | ||
resource function post pet02() returns ResponseError02|http:Accepted { | ||
http:Accepted accept = {body: ()}; | ||
return accept; | ||
} | ||
} |