pyopenapi / pyswagger

An OpenAPI (fka Swagger) client & converter in python, which is type-safe, dynamic, spec-compliant.
MIT License
385 stars 89 forks source link

Can we generate the client code for my swagger definition file just like swagger-codegen #59

Closed LouisZou closed 8 years ago

LouisZou commented 8 years ago

Now I think I can use this project to test my definition file directly by: load json send request access response.

is it correct?

But I want to generate a client SDK for other's call my api to do the test. I know swagger-codegen can generate a client code and can be used with calling api_client. how can I realize it with this project.

mission-liao commented 8 years ago

This project tends to provide a 'dynamic' client for Swagger (Open API). 'Dynamic' means you don't have to generate any static code to use your API, the library itself can be used as a 'generic' client for any Swagger (Open API) powered service. (Only supports 1.2 and 2.0 so far)

You can go through Quick Start for a basic usage of this project, and if you still have any further question, feel free to raise them here.

LouisZou commented 8 years ago

Thanks mission-liao. the dynamic client is so cool and I can use it to create a client fast.

But If I want to provide a classic SDK to my users, is there any other method?just like: api01.py: get, post, del ....

just like the swagger-codegen written by java.

mission-liao commented 8 years ago

@LouisZou sorry that we didn't provide any codegen tool, but you can still create a custom client based on this project (except those issues you opened), it should be easier to create one on your own.

The way to access an Operation Object is just somewhat cumbersome, but spec-compliant. To make it easier for your customer to access your API, I would suggest you to fulfill 'operationId' for each Operation Object you provide, or you would need to provide JSON Reference to access them.

mission-liao commented 8 years ago

No more update on this case, reopen once more action is required.