The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ

Add Swagger-based API

master
Gergely Polonkai 6 years ago
parent 07872f8e24
commit 50ef1491f2
  1. 23
      .swagger-codegen-ignore
  2. 7
      README.md
  3. 23
      api.py
  4. 11
      app.py
  5. 0
      controllers/__init__.py
  6. 3
      controllers/default_controller.py
  7. 2
      requirements.txt

@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

@ -0,0 +1,7 @@
# Rubber Duck Booking Tool
Rubber Duck Booking Tool for the masses
This tool allows you to manage your rubber duck repository, helping
your fellow developers to get the proper duck
for [debugging](http://en.wikipedia.org/wiki/Rubber_duck_debugging).

@ -1,23 +0,0 @@
# -*- coding: utf-8
from flask import Flask
from flask_restful import Resource, Api, reqparse
app = Flask(__name__)
api = Api(app)
parser = reqparse.RequestParser()
parser.add_argument('task')
class HelloWorld(Resource):
def get(self):
return {"hello": "world"}
def post(self):
print(parser.parse_args())
return {'hello': 'world'}
api.add_resource(HelloWorld, '/')
if __name__ == '__main__':
app.run(debug=True)

@ -0,0 +1,11 @@
#!/usr/bin/env python3
import connexion
if __name__ == '__main__':
app = connexion.App(__name__, specification_dir='./swagger/')
app.add_api('swagger.yaml',
arguments={
'title': 'Rubber Duck Booking Tool'
})
app.run(port=8080)

@ -0,0 +1,3 @@
def ducks_get() -> str:
return 'do some magic!'

@ -1,2 +1,4 @@
Flask==0.11.1
Flask-RESTful==0.3.5
connexion==1.0.129
gunicorn

Loading…
Cancel
Save