 Okay, thank you for the introduction. I will talk about OpenAPI development with Python. First, let me introduce myself. My name is Takuro Wada and I'm a software engineer in Kabuku Inc. Kabuku Inc. is a Japanese startup which provides manufacturing service which connects the people who want to create something and the factory who can make it. And I was a speaker of your Python 2016 and Python GP 2015. And I'm also a member of Suwaga Kojin, technical committee of Python and TypeScript. And those are my pointers in internet, so please follow it. And this is today's agenda. And first, I will talk about what is OpenAPI. So, introduction of OpenAPI and basics. And second, I will talk about OpenAPI tools. So, introduction of some useful tools to increase your productivity. And the final part of this presentation, I will talk about the actual case study of my company using OpenAPI and Python. Okay, so first, what is OpenAPI? So, who knows about OpenAPI? And who are using it for your project? Okay, thank you. So, OpenAPI is a literary API description language which is focusing on creating, averaging, and promoting vendor neutral description format. So, what can I, what can do with OpenAPI? So, it's simple. You can write your API speak with OpenAPI. So, that's simple. For more detail, OpenAPI is supporting two types of format, Yamu and JSON. And it's based on JSON schema. JSON schema is vocabulary to annotate and validate JSON. So, it makes use of JSON scheme function. And OpenAPI is originally known as Swagger. So, Swagger is renamed to OpenAPI in 2016. So, in this session, I will use the word Swagger often, but do not confuse it. It's the almost the same meaning of OpenAPI. And, yeah. So, how to use OpenAPI? So, OpenAPI is API speak itself. So, you can use it as API document. And OpenAPI code tools can generate good looking document, which means it generates HTML, CSS, and JavaScript automatically. So, once you write your API speak and generate the document, you can share it with your team front end, back end, or developers, or non-developers. Or if your service has public API, you can generate the document for any developers all over the world. Okay, so, another way to use OpenAPI is API tools. I mean, mainly code generator. So, for example, if you write API speak, you can generate source codes for validating request data from clients in server side, or generates codes for API calling part in clients. Okay, so, there are several versions of OpenAPI. And as I said, OpenAPI is originally known as Swagger, and it's renamed OpenAPI in 2016. So, version 1.2 and version 2.0 is released in, what's released in 2014. So, it's known as Swagger. And the new major version, next major version 3.0 will be released in July 2017. So, this month, maybe next week, it will be released. So, I think it's so hot technology. Yeah, and there are some computers of API. So, those kind of language is called categorized as less full API deal description language. And one is RAM, RESTful API modeling language. It's Yamur-based language. And another one is API Blueprint. It's Maclone-based. By the way, the developer of API Blueprint is Apiary, which is acquired or in the beginning of this year. And there are many more tools in OpenAPI than those tools. So, if you are starting to learning this kind of tool, I recommend you to start from OpenAPI. And I investigate Google Trends of these three. OpenAPI, also known as Swagger, is gathering more attention than others in the market. So, it's hot technology, again. So, okay. Next, OpenAPI tools. I will introduction some OpenAPI tools. So, there are two categories, big categories of OpenAPI tools. One is core tools. Those tools are developed by OpenAPI team, Swagger team. So, kind of off-shelf tools. And the other is community tools, which are developed by community. I mean, software developed all over the world. And because this is your Python, I will introduce Python tools in this session. But you can find so many language tools of the API. Okay, so, start from core tools. I want to introduce three tools in this session, Swagger UI, Swagger Editor, and Swagger Code Gen. And, okay, so, Swagger UI. Swagger UI is a tool that show your API spec with built-through format. So, once you write your API spec with YAML or JSON and give it to Swagger UI, Swagger UI automatically render the document as a HTML. And CSS, and JavaScript. And the Swagger UI is also providing feature that call your API directory from your browser page. So, you can use it as a test tool for your API. So, let's see the example. This is a right, oh, sorry. This is a right demo. And this is showing the Petal Store's API spec. You can find some API definitions and you can try it here and send the actual API request to the server and see the results in this page. Okay, back to the presentation. Okay, next, next is Swagger Editor. Swagger Editor is a with-with-spec editor in web browser. This tool provides some good feature like syntax highlighting on the compilation, real-time spec validation. So, once you write in-variate document in the Swagger Editor, Swagger Editor will notice you are writing in-variate spec line number, bra-bra-bra-bra, immediately, so it's very useful. And if you go to the URL, you can see the live demo. You can try your spec writing at the site. Okay, so, next, Swagger Code Gen. Swagger Code Gen providing function to generate servers and the clients called from your API spec. So, once you write your API spec with open API and give it to Swagger Code Gen, you can generate multiple kind of code including multiple language like Java, TypeScript, Golwin, Python, and so many other languages, Ruby or C++, yep. And, of course, some language are provided, so server code and clients code can be generated for some language. It's very useful. It's powerful. Yes, next, community tools. There are many Python tools for open API. So, many tools are introduced in the Swagger official website. So, if you go there, you can find many tools registered. And, those tools are providing function as bar data or code generator or spec parser and so on. And, some tools are for the specific framework like Frask or Pyramid bottle. And, today, I want to introduce one of these tools. It's very good. The tool is Verbal Core. Verbal Core is a Python library that as client-size and server-size supports for open API. And, it supports Python 2 and Python 3 and develop Yelp. And, I think it's good feature that it's not dedicated to any specific framework. So, you can use it in your own Python project today. And, it's very simple to use. No complicated setting. And, providing good features like validation and measuring and measuring. And, yeah. And, custom forms for type conversion. I will mention this function next. So, let's see the example. So, in this session, I will use this scheme. The name is book and the type is object which has property ID as integer, title, as string. And, author as string as well. And, ID is required property. And, to use Verbal Core, you need to prepare, prepare. So, first, load YAML file with open API spec. And, Verbal Core is also supporting JSON. So, you can use JSON spec as well. And, number two, creates Verbal Core spec object using from dict method. And, number three, retrieve book definition from load spec. And, finally, you can call variate scheme object to variate your data. So, in this code, the target variable is, will be variated. So, what will happen if the embedded data is given? Let's see the example. So, if required property ID is not defined in dict. So, in this example, I give empty dict to the method. But, ID is required, so it's embedded. This is a result. So, validation error exception is rates. And, the message is ID is required property. That's correct. And, another example, if a property has embedded type value, so, book definition, title should be string, but this dict has title with integer one. So, it's embedded. Then, validation error is also laced as well as the last example. And, the message is one is not type string. Okay, that's correct. It's very useful. And, next, a musher. A musher means converts dict type object to a pattern. So, you, the prepair procedure is the same as validation. And, you will use a musher scheme object to a musher. So, let's see the example. I'm now giving this dict ID one, title merchant of Venice, and author William Shakespeare. And, this is a good result. So, Python only object is successfully created. Book object author William Shakespeare, ID one, and the title merchant of Venice. And, one of a good feature of a musher is automatically type conversion. So, I added new property, release date, which has a string type with format date, date format. And, let's see another example. So, I added a release date key with a string value 2017-07-11. And, let's see the result. This is a result. So, the release date is converted automatically to date time dot date object. Yeah, that's very useful and powerful. And, verbal core has default defined formats, bytes, dates, double, date time, float, into 32, 4. And, those definitions are you can find in format 30.py of verbal core. And, you can also define your custom format by yourself. There is a document for the procedure. So, if you're interested, refer that URL. And, the final part of musher is, sorry, final part of verbal core is musher. So, it's inverse procedure of musher. So, convert Python model object to dicts. So, in this example, I created a book object which has ID one, title merchant of Venice, author William Shakespeare. And, the release date is date object 2017-07-11. And, this is a result. Release date is automatically converted to a string with date haunt. That's fantastic. And, there are many good features I do not mention today. So, you can refer the document. I've created some example of verbal core. So, you can go to see the example of the ULA. OK, so the final part of the presentation, actual case study. So, project overview. We are providing system which name is CubConnect. And, CubConnect is manufacturing cloud platform which connect people who want to make something. And, the factory who can make it. And, selection process is done by AI, trained with deep learning. And, this is a system architecture. So, in the CubConnect, there are two parts, front and side and back and side. And, front end is implemented with Angular, with TypeScript. And, back end is implemented by Python. And, CubConnect is connecting other services like manufacturing, management service, which enables the factory to manage their orders from clients for payment or quotation, something like that. And, also connecting data analyzing service. So, we are dealing CAD data, not only to the, but also 3D. So, data analyzing service, analyze the CAD data to calculate size of volume, something like that, to create quotation. So, we are using OpenAPI for those parts. OK, let's see the detail. So, we are using OpenAPI in CubConnect in the 3 parts. So, one is generate API document using Swagger AUI. And, the next is client call generates for API calling, Swagger Code Gen using Swagger Code Gen. And, we are creating, we are using OpenAPI to validate, for validation of request parameter from clients, using Bravo Core, yeah. And, we are also using OpenAPI with other services. So, it's, we are using generate API document with Swagger AUI, and creating call generation, using call generation for API calling using Swagger Code Gen. So, implementation workflow, so there are big two parts. One is design. So, we need to first design API structure and write OpenAPI spec. This is important for us. And, next implementation. So, once you write API spec, some part of front end can be generated automatically using Swagger Code Gen. And, Swagger Code Gen can generate mock server as well. So, the front end development can be completely isolated from back end development. And, also back end development can be isolated from front end development. So, those two process can be implemented in prior. It's very effective. So, impression for OpenAPI. Using OpenAPI to decrease your tasks so much. So, document generation, call generation is so useful. And, front end and back end, or API provider and API consumer can be implemented in parallel. So, it's very productive, I think. Okay, recap. So, OpenAPI has hot technology to describe API specification. There are many tools to increase your productivity with OpenAPI. You'll want actual trace with OpenAPI of my company. So, hot tools. And, require more contributors. So, as I said, new OpenAPI spec version 3.0 will be released in July 2017. And, there are many added good features, but we cannot make use of these good features if tools does not support it. So, tools need to support OpenAPI spec version 3 as soon as possible. Okay, let's contribute it. And, final, we are hearing. So, if you are interested in Python or 3D print, let me know. If you like Python and the Sushi and the Ninja, you are the right Python for my company. So, go to the URL. That's it, thank you. We have time for questions. Hello, thanks for your talk. I know in the spec design, you can have a description for any element. Sorry, Lelderich. I know in the document specifications, you can have a description where you can say many things about the elements. But, I was wondering, in terms of best practices to document your API, what would you recommend would be the Swagger UI or anything or any other tool that you know about it? Regarding documentation. Exactly. Yeah, Swagger UI is kind of a good documentation tool, I think, I mentioned in this presentation. About there is another document generator for OpenAPS spec. For example, Swagger Code Gen can generate static HTML document, and you can define style by yourself. So, you can choose. It depends on your situation. All right, thanks. Okay. Any other questions? If not, I've got one. Yeah, thank you for your talk. So, I have a question regarding more complex validation scenarios. So, for example, you can say that a field is required in the input data, but you might have, let's say, that is required if some other field is not present in the input data. So, basically, interfield validation scenarios and maybe other validation which depends on the context. So, how extensible is the default validation with JSON schema and if you encounter any problems with it? So, using Brava Core, it's based on JSON scheme, I said. So, it can validate constraints defined in JSON schema. So, if you want to complicate it, validation, you need to choose another tool or write your code to validate it, I think. And I wanted to ask, is there support in OpenAPI to define what an error format is going to be like? So, can I also document what the JSON structure, if I want to document this field is required, you forgot to do this, is there support for that? Sorry. Four errors, like I have a validation error. Is there a standard? Because I've seen I can define for my inputs and also I'm assuming my outputs, but can I also define the format of the output of error messages? Something like this field is required. Is that also documented in the schema? Yes, this is documented in the schema. Okay, thank you. Okay, do we have any other questions? If not, let's give a big hand to our speaker. Thank you.