Skip to content

Commit

Permalink
Add documentation and examples for new open api spec support
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Plusnick committed Nov 13, 2019
1 parent 6a31d6e commit 3a39d3e
Show file tree
Hide file tree
Showing 4 changed files with 364 additions and 13 deletions.
112 changes: 99 additions & 13 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions docs/examples/manifest_hello_world_apigateway_open_api_spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Example: Basic Hello World action with Open API Specification
project:
config: open_api_spec.json
packages:
hello_world_package:
version: 1.0
license: Apache-2.0
actions:
hello_world:
function: src/hello.js
web-export: true
60 changes: 60 additions & 0 deletions docs/examples/open_api_spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"swagger": "2.0",
"info": {
"version": "1.0",
"title": "Hello World API"
},
"basePath": "/hello",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/world": {
"get": {
"description": "Returns a greeting to the user!",
"operationId": "hello_world",
"responses": {
"200": {
"description": "Returns the greeting.",
"schema": {
"type": "string"
}
}
}
}
}

},
"x-gateway-configuration": {
"assembly": {
"execute": [
{
"operation-switch": {
"case": [
{
"operations": [
"getHello"
],
"execute": [
{
"invoke": {
"target-url": "https://openwhisk.ng.bluemix.net/api/some/action/path.http",
"verb": "keep"
}
}
]
}
],
"otherwise": []
}
}
]
}
}
}
Loading

0 comments on commit 3a39d3e

Please sign in to comment.