SlideShare uma empresa Scribd logo
1 de 40
Baixar para ler offline
OpenAPI development
with Python
EuroPython2017@Rimini, 11 July 2017
Takuro Wada
Hi
2
Kabuku Inc.
Software Engineer
@taxpon
taxpon
http://takuro.ws
- Speaker of EuroPython 2016, PyConJP 2015
- Member of swagger codegen technical committee
- Python, TypeScript
Takuro Wada
Agenda
3
1. What is OpenAPI?
Introduction and basics
2. OpenAPI tools
Introduce some tools to increase your productivity
3. Actual case study
Introduce our company’s project
What is OpenAPI?
What is OpenAPI?
OpenAPI is API description language which is focusing
on creating, evolving and promoting vendor neutral
description format
5
(Partially cited from https://www.openapis.org/about)
You can write your API spec with OpenAPI
What is OpenAPI?
‣ Supported spec format
- YAML and JSON
‣ Based on JSON schema
- Vocabulary to annotate and
validate JSON
‣ Originally known as Swagger
6
Actual example spec in YAML format
How to use OpenAPI?
‣As API documents
-Generate good looking documents
- Share API spec in team
- Frontend and Backend
- Developers and non-developers
- Public API Document for Any developers
7
How to use OpenAPI?
‣As API tools
-Code generation
- Codes for request data validation in server
- Code for API calling in clients
8
OpenAPI versions
‣OpenAPI is originally known as Swagger
- Swagger spec was renamed OpenAPI spec in 2016
9
Version Release Date
1.2 14 Mar 2014
2.0 8 Sep 2014
3.0 Will be released in July 2017
So Hot!!
https://www.openapis.org/specification/repo
OpenAPI’s competitors
‣RESTful API DL (Description Language)
-RAML (RESTful API Modeling Language)
- YAML base
-API Blueprint
- Markdown base
- Oracle acquired Apiary in Jan 2017
10
OpenAPI (Swagger) is gathering more attention than others!
Google Trends
So Hot!!
OpenAPI tools
OpenAPI tools
‣Core tools
-Developed by OpenAPI (Swagger) team
‣Community tools
-Developed by Community
-Introduce Python tools in this session
13
Core tools
‣Swagger UI
‣Swagger Editor
‣Swagger Codegen
14
Core tools (1/3)
‣Swagger UI
- Show spec with beautiful format
- Directly API calling from browser
- http://petstore.swagger.io/
15
https://github.com/swagger-api/swagger-ui
Core tools (2/3)
‣Swagger Editor
-WYSIWYG Spec editor in web browser
- Syntax highlighting, Autocompletion, Real time spec validation
- http://editor.swagger.io/#/
16
https://github.com/swagger-api/swagger-editor
Core tools (3/3)
‣Swagger Codegen
-Generate server’s and client’s code from spec
17
Swagger
Spec
Generate
Multiple languages
Swagger
Codegen
Input
Community tools
‣ There are many Python tools
for OpenAPI
- Validator
- Code generator
- Spec parser
- Some tools are for the specific
framework
18
https://swagger.io/open-source-integrations/#python-19
bravado-core
‣ Python library that adds client-side and server-side support for
OpenAPI (2.7, 3.4+, developed by Yelp, https://github.com/Yelp/bravado-core)
‣ Not dedicated to any specific framework (You can use it in you own
project today)
‣ Very simple to use
‣ Features
- Validation
- Marshaling and Unmarshaling
- Custom formats for type conversion
19
bravado-core
‣Spec example
20
Book:
type: object
required: [id]
properties:
   id:
     type: integer
   title:
     type: string
   author:
     type: string
bravado-core: (1)Validate
‣Validation execution
21
import yaml
from bravado_core.spec import Spec
# 1
with open('openapi.yaml', 'r') as f:
raw_spec = yaml.load(f)
# 2
spec = Spec.from_dict(raw_spec)
# 3
book = raw_spec[‘definitions']['Book']
# 4
validate_schema_object(spec, book, target)
1. Load YAML file with OpenAPI
spec (JSON is also OK)
2. Create Spec object
3. Retrieve “Book” definition
4. Validate (target is dict object
which is dumped from client’s
request)
bravado-core: (1)Validate
‣if required property “id” is not defined in dict:
22
validate_schema_object(spec, book, {})
Code
jsonschema.exceptions.ValidationError: 'id' is a required property
Failed validating 'required' in schema:
{'properties': {'author': {'type': 'string'},
'id': {'type': 'integer'},
'release_date': {'format': 'date', 'type': 'string'},
'title': {'type': 'string'}},
'required': ['id'],
'type': 'object',
'x-model': 'Book'}
On instance:
{}
Result
bravado-core: (1)Validation
‣If a property has invalid type value:
23
validate_schema_object(spec, book, {"id": 1, "title": 1})
Code
jsonschema.exceptions.ValidationError: 1 is not of type 'string'
Failed validating 'type' in schema['properties']['title']:
{'type': 'string'}
On instance['title']:
1
Result
bravado-core: (2)Unmarshal
‣Unmarshal (dict to object)
24
from bravado_core.unmarshal import unmarshal_schema_object
book_obj = unmarshal_schema_object(
  spec, book,
  {"id": 1,
"title": "Merchant of Venice”,
“author": "William Shakespeare"})
print(book_obj)
Code
]Dict need to be converted
Book(author='William Shakespeare', id=1, title='Merchant of Venice')
Result
Model object is created !!
bravado-core: (2)Unmarshal
‣Formatting in Unmarshal
25
Book:
type: object
required: [id]
properties:
   id:
     type: integer
   title:
     type: string
   author:
     type: string
   release_date:
     type: string
     format: date
] This property is added and
expected to be string with “date" format
bravado-core: (2)Unmarshal
‣Formatting in Unmarshal
26
book_obj = unmarshal_schema_object(
  spec, book,
  {"id": 1,
"title": "Merchant of Venice”,
“author": "William Shakespeare”,
“release_date”: “2017-07-11”})
print(book_obj)
Code
]Dict need to be converted
Book(author='William Shakespeare', id=1,
release_date=datetime.date(2017, 7, 11), title='Merchant of Venice')
Result
String with date format is successfully converted to a date object!!
bravado-core: (2)Unmarshal
‣Defined formatter
- Default defined formatter:
- byte, date, double, date-time, float, int32, int64
- formatter.py (https://github.com/Yelp/bravado-core/blob/master/bravado_core/formatter.py)
- Custom formatter by yourself
- https://github.com/Yelp/bravado-core/blob/master/docs/source/formats.rst
27
Code
bravado-core: (3)Marshal
‣Marshal (object to dict)
28
Book = spec.definitions['Book']
book_obj = Book(id=1, title="Merchant of Venice",
author="William Shakespeare”,
release_date=date(2017, 7, 11))
book_dict = marshal_schema_object(spec, book, book_obj)
print(book_dict)
]“Book” object
{'release_date': '2017-07-11', 'title': 'Merchant of Venice', 'id': 1,
'author': 'William Shakespeare'}
Result
Date object is successfully converted to string with date format!!
bravado-core
‣And many useful features
-Document
- http://bravado-core.readthedocs.io/en/latest/
-Examples
- https://github.com/taxpon/bravado-core-example
29
Actual case study
Project overview
‣Kabuku Connect
- Manufacturing cloud platform
- Connect people who want to make something and
the factories selected by AI
31
32
‣Kabuku Connect
- Frontend: Angular (TypeScript)
- Backend: Python
Backend
ServerFrontend
API
Architecture
Other
ServiceAPI
‣Other services
- Manufacturing
management service
- Data analyzing service
Kabuku Connect
Other
Service
OpenAPI OpenAPI
Backend
ServerFrontend
API
Kabuku Connect
OpenAPI
Other
ServiceAPI
Other
Service
OpenAPI
How OpenAPI is used
‣ In Kabuku Connect
33
(2)Code generation
for API calling
Swagger codegen
(1)Generate
API Document
Swagger UI
(3)Validation of request
parameters from client
bravado-core
Backend
ServerFrontend
API
Kabuku Connect
OpenAPI
Other
ServiceAPI
Other
Service
OpenAPI
How OpenAPI is used
‣ With other services
34
(2)Code generation
for API calling
Swagger codegen
(1)Generate
API Document
Swagger UI
Implementation workflow
1. Design
‣ API structure and write OpenAPI spec
35
2. Implementation
‣ Frontend (Angular, Typescript)
- Using generated clients code and mock server
‣ Backend (Python)
‣ Frontend and Backend can be implemented in parallel
Impression
‣Using OpenAPI tools decrease your
tasks so much
- Document generation
- Code generation
- Frontend and Backend, API provider and API
consumer can be implemented in parallel
36
Very
Productive!
Recap
Recap
‣OpenAPI is a hot technology to describe
API specification
38
‣There are many tools to increase your
productivity with OpenAPI
‣You learned actual case with OpenAPISo Hot!!
Required more contributors!
‣New Open API Spec (Version 3.0) will be
released in July 2017
-There are many added good features
-Tools need to support OAS v3
39
Let’s
Contribute!
We are hiring!
40
‣ Python Developer
‣ C++ Developer
‣ Frontend Developer
‣ Angular/Three.js
‣ You can use 3D printers all you want
‣ International members
‣ 3 Google Developer Experts
Some 3D printed members
https://www.kabuku.co.jp/en

Mais conteúdo relacionado

Mais procurados

Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...
Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...
Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...HostedbyConfluent
 
Building APIs with the OpenApi Spec
Building APIs with the OpenApi SpecBuilding APIs with the OpenApi Spec
Building APIs with the OpenApi SpecPedro J. Molina
 
Introducing Swagger
Introducing SwaggerIntroducing Swagger
Introducing SwaggerTony Tam
 
Programmazione funzionale e Stream in Java
Programmazione funzionale e Stream in JavaProgrammazione funzionale e Stream in Java
Programmazione funzionale e Stream in JavaCristina Attori
 
Postman: An Introduction for Developers
Postman: An Introduction for DevelopersPostman: An Introduction for Developers
Postman: An Introduction for DevelopersPostman
 
Angular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web ApplicationsAngular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web ApplicationsAlbiorix Technology
 
OpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerOpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerSmartBear
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway Chris Mague
 
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudEberhard Wolff
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation ToolIzzet Mustafaiev
 
Kuberntes Ingress with Kong
Kuberntes Ingress with KongKuberntes Ingress with Kong
Kuberntes Ingress with KongNebulaworks
 
Microservices & API Gateways
Microservices & API Gateways Microservices & API Gateways
Microservices & API Gateways Kong Inc.
 
OpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-SideOpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-SideTim Burks
 
[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...
[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...
[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...WSO2
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?LunchBadger
 
Exploring the power of OpenTelemetry on Kubernetes
Exploring the power of OpenTelemetry on KubernetesExploring the power of OpenTelemetry on Kubernetes
Exploring the power of OpenTelemetry on KubernetesRed Hat Developers
 

Mais procurados (20)

Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...
Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...
Apicurio Registry: Event-driven APIs & Schema governance for Apache Kafka | F...
 
Building APIs with the OpenApi Spec
Building APIs with the OpenApi SpecBuilding APIs with the OpenApi Spec
Building APIs with the OpenApi Spec
 
Introducing Swagger
Introducing SwaggerIntroducing Swagger
Introducing Swagger
 
Programmazione funzionale e Stream in Java
Programmazione funzionale e Stream in JavaProgrammazione funzionale e Stream in Java
Programmazione funzionale e Stream in Java
 
Postman: An Introduction for Developers
Postman: An Introduction for DevelopersPostman: An Introduction for Developers
Postman: An Introduction for Developers
 
Angular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web ApplicationsAngular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web Applications
 
OpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of SwaggerOpenAPI 3.0, And What It Means for the Future of Swagger
OpenAPI 3.0, And What It Means for the Future of Swagger
 
Swagger
SwaggerSwagger
Swagger
 
Kong API Gateway
Kong API Gateway Kong API Gateway
Kong API Gateway
 
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring Cloud
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
 
Laravel Eloquent ORM
Laravel Eloquent ORMLaravel Eloquent ORM
Laravel Eloquent ORM
 
Kuberntes Ingress with Kong
Kuberntes Ingress with KongKuberntes Ingress with Kong
Kuberntes Ingress with Kong
 
Api presentation
Api presentationApi presentation
Api presentation
 
Microservices & API Gateways
Microservices & API Gateways Microservices & API Gateways
Microservices & API Gateways
 
OpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-SideOpenAPI and gRPC Side by-Side
OpenAPI and gRPC Side by-Side
 
Angular
AngularAngular
Angular
 
[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...
[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...
[APIdays INTERFACE 2021] The Evolution of API Security for Client-side Applic...
 
What is an API Gateway?
What is an API Gateway?What is an API Gateway?
What is an API Gateway?
 
Exploring the power of OpenTelemetry on Kubernetes
Exploring the power of OpenTelemetry on KubernetesExploring the power of OpenTelemetry on Kubernetes
Exploring the power of OpenTelemetry on Kubernetes
 

Destaque

OpenAPIを利用したPythonWebアプリケーション開発
OpenAPIを利用したPythonWebアプリケーション開発OpenAPIを利用したPythonWebアプリケーション開発
OpenAPIを利用したPythonWebアプリケーション開発Takuro Wada
 
How to apply deep learning to 3 d objects
How to apply deep learning to 3 d objectsHow to apply deep learning to 3 d objects
How to apply deep learning to 3 d objectsOgushi Masaya
 
Mock it right! A beginner’s guide to world of tests and mocks, Maciej Polańczyk
Mock it right! A beginner’s guide to world of tests and mocks, Maciej PolańczykMock it right! A beginner’s guide to world of tests and mocks, Maciej Polańczyk
Mock it right! A beginner’s guide to world of tests and mocks, Maciej PolańczykPôle Systematic Paris-Region
 
EuroPython 2017 - How to make money with your Python open-source project
EuroPython 2017 - How to make money with your Python open-source projectEuroPython 2017 - How to make money with your Python open-source project
EuroPython 2017 - How to make money with your Python open-source projectMax Tepkeev
 
Type Annotations in Python: Whats, Whys and Wows!
Type Annotations in Python: Whats, Whys and Wows!Type Annotations in Python: Whats, Whys and Wows!
Type Annotations in Python: Whats, Whys and Wows!Andreas Dewes
 
Swaggerで始めるモデルファーストなAPI開発
Swaggerで始めるモデルファーストなAPI開発Swaggerで始めるモデルファーストなAPI開発
Swaggerで始めるモデルファーストなAPI開発Takuro Sasaki
 
チケットの利用による経験を活かした開発の可能性
チケットの利用による経験を活かした開発の可能性 チケットの利用による経験を活かした開発の可能性
チケットの利用による経験を活かした開発の可能性 Makoto SAKAI
 
Redmine.tokyo 07 open_discussion
Redmine.tokyo 07 open_discussionRedmine.tokyo 07 open_discussion
Redmine.tokyo 07 open_discussionJun Naitoh
 
Redmineのスマホアプリ RedminePM
Redmineのスマホアプリ RedminePMRedmineのスマホアプリ RedminePM
Redmineのスマホアプリ RedminePMproject mode, Inc.
 
Redmine.tokyo 第7回勉強会 ディスカッション
Redmine.tokyo 第7回勉強会 ディスカッションRedmine.tokyo 第7回勉強会 ディスカッション
Redmine.tokyo 第7回勉強会 ディスカッションTomohisa Kusukawa
 
Redmine 260 300_new_feature
Redmine 260 300_new_featureRedmine 260 300_new_feature
Redmine 260 300_new_featureJun Naitoh
 
Redmine.tokyo 07 questionnaire
Redmine.tokyo 07 questionnaireRedmine.tokyo 07 questionnaire
Redmine.tokyo 07 questionnaireJun Naitoh
 
Redmineはキャズムを超える -日経SYSTEMS寄稿の思い-
Redmineはキャズムを超える -日経SYSTEMS寄稿の思い- Redmineはキャズムを超える -日経SYSTEMS寄稿の思い-
Redmineはキャズムを超える -日経SYSTEMS寄稿の思い- Makoto SAKAI
 
Redmine + gitlab: merge base development
Redmine + gitlab: merge base developmentRedmine + gitlab: merge base development
Redmine + gitlab: merge base developmentsmdkk
 
Rbpdf gem library
Rbpdf gem libraryRbpdf gem library
Rbpdf gem libraryJun Naitoh
 
【第7回redmine.tokyo勉強会】RedmineのFAQとアンチパターン集~WBS駆動からチケット駆動へ
【第7回redmine.tokyo勉強会】RedmineのFAQとアンチパターン集~WBS駆動からチケット駆動へ【第7回redmine.tokyo勉強会】RedmineのFAQとアンチパターン集~WBS駆動からチケット駆動へ
【第7回redmine.tokyo勉強会】RedmineのFAQとアンチパターン集~WBS駆動からチケット駆動へakipii Oga
 
EuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOME
EuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOMEEuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOME
EuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOMEHONGJOO LEE
 
講演1 Redmine導入のアンチパターン
講演1 Redmine導入のアンチパターン講演1 Redmine導入のアンチパターン
講演1 Redmine導入のアンチパターンHidehisa Matsutani
 
Redmine4時代のプラグイン開発 redmine.tokyo #13
Redmine4時代のプラグイン開発 redmine.tokyo #13Redmine4時代のプラグイン開発 redmine.tokyo #13
Redmine4時代のプラグイン開発 redmine.tokyo #13Sho Douhashi
 

Destaque (20)

OpenAPIを利用したPythonWebアプリケーション開発
OpenAPIを利用したPythonWebアプリケーション開発OpenAPIを利用したPythonWebアプリケーション開発
OpenAPIを利用したPythonWebアプリケーション開発
 
How to apply deep learning to 3 d objects
How to apply deep learning to 3 d objectsHow to apply deep learning to 3 d objects
How to apply deep learning to 3 d objects
 
Europy17_dibernardo
Europy17_dibernardoEuropy17_dibernardo
Europy17_dibernardo
 
Mock it right! A beginner’s guide to world of tests and mocks, Maciej Polańczyk
Mock it right! A beginner’s guide to world of tests and mocks, Maciej PolańczykMock it right! A beginner’s guide to world of tests and mocks, Maciej Polańczyk
Mock it right! A beginner’s guide to world of tests and mocks, Maciej Polańczyk
 
EuroPython 2017 - How to make money with your Python open-source project
EuroPython 2017 - How to make money with your Python open-source projectEuroPython 2017 - How to make money with your Python open-source project
EuroPython 2017 - How to make money with your Python open-source project
 
Type Annotations in Python: Whats, Whys and Wows!
Type Annotations in Python: Whats, Whys and Wows!Type Annotations in Python: Whats, Whys and Wows!
Type Annotations in Python: Whats, Whys and Wows!
 
Swaggerで始めるモデルファーストなAPI開発
Swaggerで始めるモデルファーストなAPI開発Swaggerで始めるモデルファーストなAPI開発
Swaggerで始めるモデルファーストなAPI開発
 
チケットの利用による経験を活かした開発の可能性
チケットの利用による経験を活かした開発の可能性 チケットの利用による経験を活かした開発の可能性
チケットの利用による経験を活かした開発の可能性
 
Redmine.tokyo 07 open_discussion
Redmine.tokyo 07 open_discussionRedmine.tokyo 07 open_discussion
Redmine.tokyo 07 open_discussion
 
Redmineのスマホアプリ RedminePM
Redmineのスマホアプリ RedminePMRedmineのスマホアプリ RedminePM
Redmineのスマホアプリ RedminePM
 
Redmine.tokyo 第7回勉強会 ディスカッション
Redmine.tokyo 第7回勉強会 ディスカッションRedmine.tokyo 第7回勉強会 ディスカッション
Redmine.tokyo 第7回勉強会 ディスカッション
 
Redmine 260 300_new_feature
Redmine 260 300_new_featureRedmine 260 300_new_feature
Redmine 260 300_new_feature
 
Redmine.tokyo 07 questionnaire
Redmine.tokyo 07 questionnaireRedmine.tokyo 07 questionnaire
Redmine.tokyo 07 questionnaire
 
Redmineはキャズムを超える -日経SYSTEMS寄稿の思い-
Redmineはキャズムを超える -日経SYSTEMS寄稿の思い- Redmineはキャズムを超える -日経SYSTEMS寄稿の思い-
Redmineはキャズムを超える -日経SYSTEMS寄稿の思い-
 
Redmine + gitlab: merge base development
Redmine + gitlab: merge base developmentRedmine + gitlab: merge base development
Redmine + gitlab: merge base development
 
Rbpdf gem library
Rbpdf gem libraryRbpdf gem library
Rbpdf gem library
 
【第7回redmine.tokyo勉強会】RedmineのFAQとアンチパターン集~WBS駆動からチケット駆動へ
【第7回redmine.tokyo勉強会】RedmineのFAQとアンチパターン集~WBS駆動からチケット駆動へ【第7回redmine.tokyo勉強会】RedmineのFAQとアンチパターン集~WBS駆動からチケット駆動へ
【第7回redmine.tokyo勉強会】RedmineのFAQとアンチパターン集~WBS駆動からチケット駆動へ
 
EuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOME
EuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOMEEuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOME
EuroPython 2017 - PyData - Deep Learning your Broadband Network @ HOME
 
講演1 Redmine導入のアンチパターン
講演1 Redmine導入のアンチパターン講演1 Redmine導入のアンチパターン
講演1 Redmine導入のアンチパターン
 
Redmine4時代のプラグイン開発 redmine.tokyo #13
Redmine4時代のプラグイン開発 redmine.tokyo #13Redmine4時代のプラグイン開発 redmine.tokyo #13
Redmine4時代のプラグイン開発 redmine.tokyo #13
 

Semelhante a OpenAPI development with Python

Usable APIs at Scale
Usable APIs at ScaleUsable APIs at Scale
Usable APIs at ScaleTim Burks
 
2022 APIsecure_Securing APIs with Open Standards
2022 APIsecure_Securing APIs with Open Standards2022 APIsecure_Securing APIs with Open Standards
2022 APIsecure_Securing APIs with Open StandardsAPIsecure_ Official
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays
 
API First with Connexion - PyConWeb 2018
API First with Connexion - PyConWeb 2018API First with Connexion - PyConWeb 2018
API First with Connexion - PyConWeb 2018Henning Jacobs
 
Enforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationEnforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationTim Burks
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCTim Burks
 
DocDokuPLM: Domain Specific PaaS and Business Oriented API
DocDokuPLM: Domain Specific PaaS and Business Oriented APIDocDokuPLM: Domain Specific PaaS and Business Oriented API
DocDokuPLM: Domain Specific PaaS and Business Oriented APIDocDoku
 
DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris.
DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris. DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris.
DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris. OW2
 
Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016
Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016
Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016Eric Descargues
 
APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...
APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...
APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...apidays
 
Automating the API Product Lifecycle
Automating the API Product LifecycleAutomating the API Product Lifecycle
Automating the API Product LifecycleOlyaSurits
 
Practices and tools for building better APIs
Practices and tools for building better APIsPractices and tools for building better APIs
Practices and tools for building better APIsNLJUG
 
Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Peter Hendriks
 
Araport Workshop Tutorial 2: Authentication and the Agave Profiles Service
Araport Workshop Tutorial 2: Authentication and the Agave Profiles ServiceAraport Workshop Tutorial 2: Authentication and the Agave Profiles Service
Araport Workshop Tutorial 2: Authentication and the Agave Profiles Servicestevemock
 
Tutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPTutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPAndrew Rota
 
Making Things Work Together
Making Things Work TogetherMaking Things Work Together
Making Things Work TogetherSubbu Allamaraju
 
How to Create the API Document from Real API and Localization
How to Create the API Document from Real API and Localization How to Create the API Document from Real API and Localization
How to Create the API Document from Real API and Localization Pronovix
 
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...Restlet
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsTom Johnson
 

Semelhante a OpenAPI development with Python (20)

Usable APIs at Scale
Usable APIs at ScaleUsable APIs at Scale
Usable APIs at Scale
 
2022 APIsecure_Securing APIs with Open Standards
2022 APIsecure_Securing APIs with Open Standards2022 APIsecure_Securing APIs with Open Standards
2022 APIsecure_Securing APIs with Open Standards
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
 
API First with Connexion - PyConWeb 2018
API First with Connexion - PyConWeb 2018API First with Connexion - PyConWeb 2018
API First with Connexion - PyConWeb 2018
 
Enforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code GenerationEnforcing API Design Rules for High Quality Code Generation
Enforcing API Design Rules for High Quality Code Generation
 
Build Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPCBuild Great Networked APIs with Swift, OpenAPI, and gRPC
Build Great Networked APIs with Swift, OpenAPI, and gRPC
 
DocDokuPLM: Domain Specific PaaS and Business Oriented API
DocDokuPLM: Domain Specific PaaS and Business Oriented APIDocDokuPLM: Domain Specific PaaS and Business Oriented API
DocDokuPLM: Domain Specific PaaS and Business Oriented API
 
DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris.
DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris. DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris.
DocDokuPLM : Domain Specific PaaS and Business Oriented API, OW2con'16, Paris.
 
Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016
Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016
Domain specific-paa s-and-business-oriented-api-docdoku-ow2con-2016
 
APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...
APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...
APIdays Paris 2019 - API Descriptions as Product Code by Phil Sturgeon, Stopl...
 
Automating the API Product Lifecycle
Automating the API Product LifecycleAutomating the API Product Lifecycle
Automating the API Product Lifecycle
 
Practices and tools for building better APIs
Practices and tools for building better APIsPractices and tools for building better APIs
Practices and tools for building better APIs
 
Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)Practices and tools for building better API (JFall 2013)
Practices and tools for building better API (JFall 2013)
 
Araport Workshop Tutorial 2: Authentication and the Agave Profiles Service
Araport Workshop Tutorial 2: Authentication and the Agave Profiles ServiceAraport Workshop Tutorial 2: Authentication and the Agave Profiles Service
Araport Workshop Tutorial 2: Authentication and the Agave Profiles Service
 
OpenAPI Extensions for OSLC
OpenAPI Extensions for OSLCOpenAPI Extensions for OSLC
OpenAPI Extensions for OSLC
 
Tutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPTutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHP
 
Making Things Work Together
Making Things Work TogetherMaking Things Work Together
Making Things Work Together
 
How to Create the API Document from Real API and Localization
How to Create the API Document from Real API and Localization How to Create the API Document from Real API and Localization
How to Create the API Document from Real API and Localization
 
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
APIdays Paris 2014 - Workshop - Craft and Deploy Your API in a Few Clicks Wit...
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
 

Mais de Takuro Wada

20170830 euro python_2017_report
20170830 euro python_2017_report20170830 euro python_2017_report
20170830 euro python_2017_reportTakuro Wada
 
株式会社カブク システム開発最前線
株式会社カブク システム開発最前線株式会社カブク システム開発最前線
株式会社カブク システム開発最前線Takuro Wada
 
3D Modeling and Printing by Python
3D Modeling and Printing by Python3D Modeling and Printing by Python
3D Modeling and Printing by PythonTakuro Wada
 
Blenderで作成したデータをMinecraftにぶっこむ
Blenderで作成したデータをMinecraftにぶっこむBlenderで作成したデータをMinecraftにぶっこむ
Blenderで作成したデータをMinecraftにぶっこむTakuro Wada
 
3Dプリント×Python ~コードからアプローチする3Dプリンティング~
3Dプリント×Python ~コードからアプローチする3Dプリンティング~3Dプリント×Python ~コードからアプローチする3Dプリンティング~
3Dプリント×Python ~コードからアプローチする3Dプリンティング~Takuro Wada
 
3D Modeling by Python scripts
3D Modeling by Python scripts3D Modeling by Python scripts
3D Modeling by Python scriptsTakuro Wada
 
20151101 blender python_3dprint
20151101 blender python_3dprint20151101 blender python_3dprint
20151101 blender python_3dprintTakuro Wada
 
3D Printing by Python scripts and Blender
3D Printing by Python scripts and Blender3D Printing by Python scripts and Blender
3D Printing by Python scripts and BlenderTakuro Wada
 

Mais de Takuro Wada (8)

20170830 euro python_2017_report
20170830 euro python_2017_report20170830 euro python_2017_report
20170830 euro python_2017_report
 
株式会社カブク システム開発最前線
株式会社カブク システム開発最前線株式会社カブク システム開発最前線
株式会社カブク システム開発最前線
 
3D Modeling and Printing by Python
3D Modeling and Printing by Python3D Modeling and Printing by Python
3D Modeling and Printing by Python
 
Blenderで作成したデータをMinecraftにぶっこむ
Blenderで作成したデータをMinecraftにぶっこむBlenderで作成したデータをMinecraftにぶっこむ
Blenderで作成したデータをMinecraftにぶっこむ
 
3Dプリント×Python ~コードからアプローチする3Dプリンティング~
3Dプリント×Python ~コードからアプローチする3Dプリンティング~3Dプリント×Python ~コードからアプローチする3Dプリンティング~
3Dプリント×Python ~コードからアプローチする3Dプリンティング~
 
3D Modeling by Python scripts
3D Modeling by Python scripts3D Modeling by Python scripts
3D Modeling by Python scripts
 
20151101 blender python_3dprint
20151101 blender python_3dprint20151101 blender python_3dprint
20151101 blender python_3dprint
 
3D Printing by Python scripts and Blender
3D Printing by Python scripts and Blender3D Printing by Python scripts and Blender
3D Printing by Python scripts and Blender
 

Último

Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 

Último (20)

Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 

OpenAPI development with Python

  • 2. Hi 2 Kabuku Inc. Software Engineer @taxpon taxpon http://takuro.ws - Speaker of EuroPython 2016, PyConJP 2015 - Member of swagger codegen technical committee - Python, TypeScript Takuro Wada
  • 3. Agenda 3 1. What is OpenAPI? Introduction and basics 2. OpenAPI tools Introduce some tools to increase your productivity 3. Actual case study Introduce our company’s project
  • 5. What is OpenAPI? OpenAPI is API description language which is focusing on creating, evolving and promoting vendor neutral description format 5 (Partially cited from https://www.openapis.org/about) You can write your API spec with OpenAPI
  • 6. What is OpenAPI? ‣ Supported spec format - YAML and JSON ‣ Based on JSON schema - Vocabulary to annotate and validate JSON ‣ Originally known as Swagger 6 Actual example spec in YAML format
  • 7. How to use OpenAPI? ‣As API documents -Generate good looking documents - Share API spec in team - Frontend and Backend - Developers and non-developers - Public API Document for Any developers 7
  • 8. How to use OpenAPI? ‣As API tools -Code generation - Codes for request data validation in server - Code for API calling in clients 8
  • 9. OpenAPI versions ‣OpenAPI is originally known as Swagger - Swagger spec was renamed OpenAPI spec in 2016 9 Version Release Date 1.2 14 Mar 2014 2.0 8 Sep 2014 3.0 Will be released in July 2017 So Hot!! https://www.openapis.org/specification/repo
  • 10. OpenAPI’s competitors ‣RESTful API DL (Description Language) -RAML (RESTful API Modeling Language) - YAML base -API Blueprint - Markdown base - Oracle acquired Apiary in Jan 2017 10
  • 11. OpenAPI (Swagger) is gathering more attention than others! Google Trends So Hot!!
  • 13. OpenAPI tools ‣Core tools -Developed by OpenAPI (Swagger) team ‣Community tools -Developed by Community -Introduce Python tools in this session 13
  • 14. Core tools ‣Swagger UI ‣Swagger Editor ‣Swagger Codegen 14
  • 15. Core tools (1/3) ‣Swagger UI - Show spec with beautiful format - Directly API calling from browser - http://petstore.swagger.io/ 15 https://github.com/swagger-api/swagger-ui
  • 16. Core tools (2/3) ‣Swagger Editor -WYSIWYG Spec editor in web browser - Syntax highlighting, Autocompletion, Real time spec validation - http://editor.swagger.io/#/ 16 https://github.com/swagger-api/swagger-editor
  • 17. Core tools (3/3) ‣Swagger Codegen -Generate server’s and client’s code from spec 17 Swagger Spec Generate Multiple languages Swagger Codegen Input
  • 18. Community tools ‣ There are many Python tools for OpenAPI - Validator - Code generator - Spec parser - Some tools are for the specific framework 18 https://swagger.io/open-source-integrations/#python-19
  • 19. bravado-core ‣ Python library that adds client-side and server-side support for OpenAPI (2.7, 3.4+, developed by Yelp, https://github.com/Yelp/bravado-core) ‣ Not dedicated to any specific framework (You can use it in you own project today) ‣ Very simple to use ‣ Features - Validation - Marshaling and Unmarshaling - Custom formats for type conversion 19
  • 20. bravado-core ‣Spec example 20 Book: type: object required: [id] properties:    id:      type: integer    title:      type: string    author:      type: string
  • 21. bravado-core: (1)Validate ‣Validation execution 21 import yaml from bravado_core.spec import Spec # 1 with open('openapi.yaml', 'r') as f: raw_spec = yaml.load(f) # 2 spec = Spec.from_dict(raw_spec) # 3 book = raw_spec[‘definitions']['Book'] # 4 validate_schema_object(spec, book, target) 1. Load YAML file with OpenAPI spec (JSON is also OK) 2. Create Spec object 3. Retrieve “Book” definition 4. Validate (target is dict object which is dumped from client’s request)
  • 22. bravado-core: (1)Validate ‣if required property “id” is not defined in dict: 22 validate_schema_object(spec, book, {}) Code jsonschema.exceptions.ValidationError: 'id' is a required property Failed validating 'required' in schema: {'properties': {'author': {'type': 'string'}, 'id': {'type': 'integer'}, 'release_date': {'format': 'date', 'type': 'string'}, 'title': {'type': 'string'}}, 'required': ['id'], 'type': 'object', 'x-model': 'Book'} On instance: {} Result
  • 23. bravado-core: (1)Validation ‣If a property has invalid type value: 23 validate_schema_object(spec, book, {"id": 1, "title": 1}) Code jsonschema.exceptions.ValidationError: 1 is not of type 'string' Failed validating 'type' in schema['properties']['title']: {'type': 'string'} On instance['title']: 1 Result
  • 24. bravado-core: (2)Unmarshal ‣Unmarshal (dict to object) 24 from bravado_core.unmarshal import unmarshal_schema_object book_obj = unmarshal_schema_object(   spec, book,   {"id": 1, "title": "Merchant of Venice”, “author": "William Shakespeare"}) print(book_obj) Code ]Dict need to be converted Book(author='William Shakespeare', id=1, title='Merchant of Venice') Result Model object is created !!
  • 25. bravado-core: (2)Unmarshal ‣Formatting in Unmarshal 25 Book: type: object required: [id] properties:    id:      type: integer    title:      type: string    author:      type: string    release_date:      type: string      format: date ] This property is added and expected to be string with “date" format
  • 26. bravado-core: (2)Unmarshal ‣Formatting in Unmarshal 26 book_obj = unmarshal_schema_object(   spec, book,   {"id": 1, "title": "Merchant of Venice”, “author": "William Shakespeare”, “release_date”: “2017-07-11”}) print(book_obj) Code ]Dict need to be converted Book(author='William Shakespeare', id=1, release_date=datetime.date(2017, 7, 11), title='Merchant of Venice') Result String with date format is successfully converted to a date object!!
  • 27. bravado-core: (2)Unmarshal ‣Defined formatter - Default defined formatter: - byte, date, double, date-time, float, int32, int64 - formatter.py (https://github.com/Yelp/bravado-core/blob/master/bravado_core/formatter.py) - Custom formatter by yourself - https://github.com/Yelp/bravado-core/blob/master/docs/source/formats.rst 27
  • 28. Code bravado-core: (3)Marshal ‣Marshal (object to dict) 28 Book = spec.definitions['Book'] book_obj = Book(id=1, title="Merchant of Venice", author="William Shakespeare”, release_date=date(2017, 7, 11)) book_dict = marshal_schema_object(spec, book, book_obj) print(book_dict) ]“Book” object {'release_date': '2017-07-11', 'title': 'Merchant of Venice', 'id': 1, 'author': 'William Shakespeare'} Result Date object is successfully converted to string with date format!!
  • 29. bravado-core ‣And many useful features -Document - http://bravado-core.readthedocs.io/en/latest/ -Examples - https://github.com/taxpon/bravado-core-example 29
  • 31. Project overview ‣Kabuku Connect - Manufacturing cloud platform - Connect people who want to make something and the factories selected by AI 31
  • 32. 32 ‣Kabuku Connect - Frontend: Angular (TypeScript) - Backend: Python Backend ServerFrontend API Architecture Other ServiceAPI ‣Other services - Manufacturing management service - Data analyzing service Kabuku Connect Other Service OpenAPI OpenAPI
  • 33. Backend ServerFrontend API Kabuku Connect OpenAPI Other ServiceAPI Other Service OpenAPI How OpenAPI is used ‣ In Kabuku Connect 33 (2)Code generation for API calling Swagger codegen (1)Generate API Document Swagger UI (3)Validation of request parameters from client bravado-core
  • 34. Backend ServerFrontend API Kabuku Connect OpenAPI Other ServiceAPI Other Service OpenAPI How OpenAPI is used ‣ With other services 34 (2)Code generation for API calling Swagger codegen (1)Generate API Document Swagger UI
  • 35. Implementation workflow 1. Design ‣ API structure and write OpenAPI spec 35 2. Implementation ‣ Frontend (Angular, Typescript) - Using generated clients code and mock server ‣ Backend (Python) ‣ Frontend and Backend can be implemented in parallel
  • 36. Impression ‣Using OpenAPI tools decrease your tasks so much - Document generation - Code generation - Frontend and Backend, API provider and API consumer can be implemented in parallel 36 Very Productive!
  • 37. Recap
  • 38. Recap ‣OpenAPI is a hot technology to describe API specification 38 ‣There are many tools to increase your productivity with OpenAPI ‣You learned actual case with OpenAPISo Hot!!
  • 39. Required more contributors! ‣New Open API Spec (Version 3.0) will be released in July 2017 -There are many added good features -Tools need to support OAS v3 39 Let’s Contribute!
  • 40. We are hiring! 40 ‣ Python Developer ‣ C++ Developer ‣ Frontend Developer ‣ Angular/Three.js ‣ You can use 3D printers all you want ‣ International members ‣ 3 Google Developer Experts Some 3D printed members https://www.kabuku.co.jp/en