Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server generate for flask (python) #17

Open
totaluserkksssssks opened this issue May 29, 2019 · 4 comments
Open

server generate for flask (python) #17

totaluserkksssssks opened this issue May 29, 2019 · 4 comments

Comments

@totaluserkksssssks
Copy link

hi,
is it possible to generate server file for flask?

https://jdegre.github.io/5GC_APIs/editor/?url=https://raw.githubusercontent.com/jdegre/5GC_APIs/master/TS29122_NIDD.yaml

@jdegre
Copy link
Owner

jdegre commented May 30, 2019

Hi @totaluserkksssssks, you may want to have a look at projects such as swagger-api/swagger-codegen or OpenAPITools/openapi-generator. Both claim to support python/flask for generation of server stubs.

The server-side generators included in the Swagger Editor apparently do not support python/flask for OpenAPI 3, and they only support it for Swagger 2.

@H21lab
Copy link

H21lab commented Jun 4, 2020

Hi,
I pushed here sample project to generate the code from this repository by using OpenAPITools/openapi-generator. However some generators are not mature yet for OpenAPI 3.

For python flask generated code I have reported this issue OpenAPITools/openapi-generator#6483 and also encountered this problem OpenAPITools/openapi-generator#3345.

@gatopeich
Copy link

In my experience using Python with these specs, the code generated by swagger and openapi-generator (its "bastard" fork) was only useful to get to "Hello World". Implementing actual Network Functions goes far beyond.

I would recommend choosing the REST framework that better fits your project, then adding a OpenAPI validation+normalization "middleware" layer. In my project we had to develop mostly from scratch due to the lack of stable libraries back in 2018.

With Python the biggest challenge is HTTP/2. A reverse-proxy can solve the server side. For the client side there is a nice clean Python binding for Nginx's nghttp2 library called pynghttp2.

@tnmtechnologies
Copy link

Hello,

At b<>com, we also work with OpenAPITools/openapi-generator in order to generate producer and consumer source code from 3GPP 5GC OpenAPI files.
Please visit our web site https://5g.labs.b-com.com/ for more information.
Some information about source code generation is available in presentation slides done at OSA workshops.
Feel free to contact us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants