-
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 #1596 from ballerina-platform/improve-test-coverage
Improve test coverage after restructuring
- Loading branch information
Showing
27 changed files
with
921 additions
and
55 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
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
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
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
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
46 changes: 46 additions & 0 deletions
46
openapi-cli/src/test/resources/ballerina-to-openapi/data_type/table_types.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,46 @@ | ||
import ballerina/http; | ||
import ballerina/time; | ||
|
||
type AppointmentTable table<Appointment> key(id); | ||
|
||
public type Appointment record {| | ||
readonly string id; | ||
string description; | ||
string doctorId; | ||
time:Date date?; | ||
|}; | ||
|
||
public type Pet record {| | ||
string name; | ||
readonly string tag; | ||
decimal age; | ||
AppointmentTable appointments?; | ||
|}; | ||
|
||
table<Pet> key(tag) pets = table [ | ||
{name: "Tommy", tag: "dog", age: 2.5}, | ||
{ | ||
name: "Lucy", | ||
tag: "cat", | ||
age: 1.5, | ||
appointments: table [ | ||
{id: "1", description: "Vaccination", doctorId: "1"}, | ||
{id: "2", description: "Checkup", doctorId: "2"} | ||
] | ||
} | ||
]; | ||
|
||
service /payloadV on new http:Listener(9090) { | ||
|
||
resource function get pets() returns table<Pet> { | ||
return pets; | ||
} | ||
|
||
resource function get pets/[string tag]() returns Pet { | ||
return pets.get(tag); | ||
} | ||
|
||
resource function get pets/[string tag]/appointments() returns AppointmentTable { | ||
return pets.get(tag).appointments ?: table []; | ||
} | ||
} |
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
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
Oops, something went wrong.