Skip to content

Instantly share code, notes, and snippets.

View maheeka's full-sized avatar

Maheeka Jayasuriya maheeka

View GitHub Profile
@maheeka
maheeka / PeopleManagementService.bal
Last active July 27, 2017 09:59
PeopleManagementService.bal
import ballerina.net.http;
import ballerina.lang.messages;
import ballerina.lang.errors;
import ballerina.lang.math;
Person[] people = [{name:"Ann", age:30, city:"London"}, {name:"Tim", age:20, city:"New York"}, {name:"John", age:25, city:"Brisbane"},
{name:"Sarah", age:10, city:"Chicago"}, {name:"Trevor", age:45, city:"Cape Town"}];
@http:configuration {basePath: "/people"}
service<http> PeopleManagementService {
struct Person {
string first_name;
string last_name;
int age;
string city;
}
struct User {
import ballerina.net.http;
struct Address {
string address;
string street;
string state;
string city;
string zip;
}
{
"basePath": "/v2",
"definitions": {
"Category": {
"properties": {
"id": {
"format": "int64",
"type": "integer"
},
"name": {
{
"host": "petstore.swagger.io",
"info": {
"contact": {
"email": "apiteam@swagger.io"
},
"description": "",
"title": "Swagger Petstore",
"version": "1.0.0"
},
{
"basePath": "/v2",
"host": "petstore.swagger.io",
"paths": {
"/pet": {
"post": {
"consumes": [
],
"description": "",
"operationId": "",