Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a scenario for Apicurio #1044

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
191 changes: 191 additions & 0 deletions apicurio/assets/airport-codes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
{
"swagger": "2.0",
"info": {
"description": "A super great RESTful API that allows developers to lookup the codes for all the major international airports. Also, the API allows adminstrators to add a new airport code as needed.",
"version": "0.0.9",
"title": "Airport Codes Lookup API",
"contact": {
"email": "[email protected]"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"host": "virtserver.swaggerhub.com",
"basePath": "/breselman/GoodAirportCodes/0.0.9",
"tags": [
{
"name": "admins",
"description": "Secured Admin-only calls"
},
{
"name": "developers",
"description": "Operations available to regular developers"
}
],
"schemes": [
"https"
],
"paths": {
"/airportCodes/{code}": {
"get": {
"tags": [
"developers"
],
"summary": "gets a particular airport code",
"description": "Gets airport information that corresponds to the submitted aiport code.\n",
"operationId": "getAirportCode",
"produces": [
"application/json"
],
"parameters": [
{
"name": "code",
"in": "path",
"description": "The aiport code to lookup",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "the result that corresponds to the submitted airport code",
"schema": {
"$ref": "#/definitions/AirportCode"
}
},
"400": {
"description": "bad input parameter",
"schema": {
"$ref": "#/definitions/AirportCodeInputError"
}
}
}
}
},
"/airportCodes": {
"get": {
"tags": [
"developers"
],
"summary": "gets all airport codes that corresponds to the search term",
"description": "Gets airport information that corresponds to the submitted search term. If no search term is provides, all codes are returned\n",
"operationId": "searchAirportCodes",
"produces": [
"application/json"
],
"parameters": [
{
"name": "searchterm",
"in": "query",
"description": "search term to process",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "the result that corresponds to the submitted search term",
"schema": {
"$ref": "#/definitions/AirportCodes"
}
},
"400": {
"description": "bad request",
"schema": {
"$ref": "#/definitions/AirportCodeInputError"
}
}
}
},
"post": {
"tags": [
"admins"
],
"summary": "adds a new Airport Code to the resource",
"description": "Adds an new aiport code to the resource\n",
"operationId": "setAirportCode",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"in": "body",
"name": "body",
"description": "The airport code to add",
"required": true,
"schema": {
"$ref": "#/definitions/AirportCode"
}
}
],
"responses": {
"200": {
"description": "Returns the newly created airport code",
"schema": {
"$ref": "#/definitions/AirportCode"
}
},
"400": {
"description": "bad input parameter",
"schema": {
"$ref": "#/definitions/AirportCodeInputError"
}
}
}
}
}
},
"definitions": {
"AirportCodeInputError": {
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "Bad input data"
}
}
},
"AirportCode": {
"type": "object",
"required": [
"airport",
"code"
],
"properties": {
"airport": {
"type": "string",
"example": "Mock of Los Angeles International Aiport"
},
"code": {
"type": "string",
"example": "LAX"
}
}
},
"AirportCodes": {
"type": "array",
"items": {
"$ref": "#/definitions/AirportCode"
},
"example": [
{
"code": "LAX",
"description": "Los Angeles International Airport"
},
{
"code": "LGA",
"description": "LaGuardia Airport"
},
{
"code": "EWR",
"description": "Newark International Airport"
}
]
}
}
}
Binary file added apicurio/assets/apicurio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apicurio/assets/command.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apicurio/assets/schema-registry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
100 changes: 100 additions & 0 deletions apicurio/assets/seatsaver.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
syntax = "proto3";

package seatsaver;

option objc_class_prefix = "SEATSAVER";

/* Describes a customer associated with a seat. */
message Customer {
string firstName = 1;
string lastName = 2;
string email = 3;
string created = 4;
string message = 5;
}
/* Describes a possible status of a seat */
enum Status {
RELEASING = 0;
OPEN = 1;
RESERVING = 2;
RESERVED = 3;
SELLING = 4;
SOLD = 5;
}

/* Describes a seat */
message Seat {
string id = 1;
string number = 2;
string section = 3;
Status status = 4;
string changed = 5;
string created = 6;
Customer customer = 7;
string message = 8;
}

/* Describes a venue that has seats */
message Venue {
string id = 1;
string name = 2;
string address = 3;
string city = 4;
string state_province = 5;
string postal_code = 6;
string country = 7;
string changed = 8;
string created = 9;
repeated Seat seats = 10;
string message = 11;
}

message Authentication {
string authenticationId = 1;
string message = 2;
}
message VenueRequest {
string venueId = 1;
string authenticationId = 2;
}

message SeatRequest {
string venueId = 1;
string seatId = 2;
string authenticationId = 3;
}

message SeatStatusRequest {
string venueId = 1;
Seat seat = 2;
string authenticationId = 3;
}

message PingRequest {
string authenticationId = 1;
int32 streamItemCount = 2;
}

message PingResponse {
string runtimeInfo = 1;
string message = 2;
}

message VenuesResponse {
repeated Venue venues = 1;
string message = 2;
}

service SeatSaverService {
rpc GetVenues(Authentication) returns (stream Venue) {}
rpc GetVenue(VenueRequest) returns (Venue) {}
rpc GetOpenSeats(VenueRequest) returns (stream Seat) {}
rpc GetSoldSeats(VenueRequest) returns (stream Seat) {}
rpc GetReservedSeats(VenueRequest) returns (stream Seat) {}
rpc GetSeats(VenueRequest) returns (stream Seat) {}
rpc ReserveSeat(SeatStatusRequest) returns (Seat) {}
rpc ReleaseSeat(SeatStatusRequest) returns (Seat) {}
rpc BuySeat(SeatStatusRequest) returns (Seat) {}
rpc Ping(PingRequest) returns (PingResponse) {}
rpc PingStream(PingRequest) returns (stream PingResponse) {}
}
30 changes: 30 additions & 0 deletions apicurio/assets/simple.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Big Bob's Thinking Tools",
"description": "A product from Big Bob's Thinking Tools catalog",
"type": "object",
"properties": {
"id": {
"description": "The unique identifier for a product",
"type": "integer"
},
"name": {
"description": "Name of the product",
"type": "string"
},
"price": {
"type": "number",
"minimum": 0,
"exclusiveMinimum": true
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
}
},
"required": ["id", "name", "price"]
}
66 changes: 66 additions & 0 deletions apicurio/assets/simple.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
syntax = "proto3";

package simplegrpc;

/* Describes an array of floats to be processed */
message Request {
repeated double numbers = 1;
}

/* Describes the result of processing */
message Response {
double result = 1;
}

/* Describes the request for a repeated value
value, the string to repeat
limit, the number of times to repeat
*/
message RepeatRequest {
string value = 1;
int32 limit = 2;
}

/* Describes the response for a repeated value
value, the repeated string
limit, the ordinal position in the response stream
*/
message RepeatResponse {
string value = 1;
int32 counter = 2;
}

/* Describes the response from a Ping call
*/
message PingResponse {
string result = 1;
}

/* Describes the request to a Ping call
*/
message PingRequest {
string data = 1;
}

service SimpleService {
rpc Add (Request) returns (Response) {
}

rpc Subtract (Request) returns (Response) {
}

rpc Multiply (Request) returns (Response) {
}

rpc Divide (Request) returns (Response) {
}

rpc Repeat (RepeatRequest) returns (stream RepeatResponse) {
}

rpc Ping (PingRequest) returns (PingResponse) {
}

rpc Pings (PingRequest) returns (repeated PingResponse) {
}
}
Loading