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

Python AIOHTTP server generator #1470

Merged
merged 4 commits into from
Jan 11, 2019

Conversation

Jyhess
Copy link
Contributor

@Jyhess Jyhess commented Nov 16, 2018

@wing328 @taxpon @frol @mbohlool @cbornet @kenjones-cisco @tomplus

Following issue 1322, I started to write a generator for aiohttp server.
It's a work in progress, and I would like early review and help to fix some remaining issues.

Note:

  • I think some improvements can be applied to flask generator (like security management for example), but for the moment, I didn't change it as I'm not familiar with.

And here is some questions:

In preprocessOpenAPI function, I set body name to "body" by default. I would like set it to type name (pet or user is better, but didn't figure how to get easily this information. Do you know how I can find this information ?

In model.mustach, I would like to generate imports for other generated class, like

from openapi_server.models.category import Category
from openapi_server.models.tag import Tag

Do you know how I can do that ? There is the same issue with Flask generator.

In test controllers, examples are not generated. Any clue on that ?

Do you know why side files, like git_push.sh, or setup.py are generated? I'm not sure they should be part of a code generator.

@wing328
Copy link
Member

wing328 commented Nov 24, 2018

Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors.

Let me know if you need help fixing it.

Ref: https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-can-i-update-commits-that-are-not-linked-to-my-github-account

@wing328
Copy link
Member

wing328 commented Nov 24, 2018

@Jyhess thanks for the PR. Are you free on the coming week to have a quick chat about this PR?

I'm available via https://gitter.im (ID: wing328) or Google Hangout (you can find the email address in my profile page)

@Jyhess
Copy link
Contributor Author

Jyhess commented Nov 26, 2018 via email

@Jyhess Jyhess force-pushed the aiohttp_server_generator branch 2 times, most recently from 8e17002 to fe785d5 Compare December 3, 2018 15:42
@wing328 wing328 changed the title Aiohttp server generator Python AIOHTTP server generator Dec 4, 2018
@wing328 wing328 added this to the 4.0.0 milestone Dec 4, 2018
@wing328
Copy link
Member

wing328 commented Dec 4, 2018

@Jyhess currently, we test the python clients in Travis by adding the folders to pom.xml: https://github.com/OpenAPITools/openapi-generator/blob/master/pom.xml#L1039

If it's not a lot of work, I suggest we do the same for Python AIOHTTP Petstore server samples by adding a pom.xml under samples/server/petstore/aiohttpConnexion/

@Jyhess
Copy link
Contributor Author

Jyhess commented Dec 4, 2018

Tests for generated server cannot succeed until this PR on connexion is not released.

Moreover, there is some other issues in generated tests for the moment:

  • examples are empty, which occur validation error for mandatory fields
  • form and file upload are not yet managed
  • body with list are not yet supported
    I will try to fix them, but I don't know when.

I will add travis files and find a way to deactivate or fix failing tests.

@Jyhess Jyhess force-pushed the aiohttp_server_generator branch 2 times, most recently from 84f13ba to 2dd48a5 Compare December 7, 2018 09:28
@Jyhess
Copy link
Contributor Author

Jyhess commented Dec 12, 2018

@wing328 I fixed tests. I also added and fixed tests for python-flask generator.

@Jyhess Jyhess force-pushed the aiohttp_server_generator branch from 2dd48a5 to 33e322e Compare January 7, 2019 16:22
@wing328
Copy link
Member

wing328 commented Jan 9, 2019

I'll review again later today or tomorrow and merge it into master if no further feedback

@Jyhess Jyhess force-pushed the aiohttp_server_generator branch from f89d07e to 6549dc8 Compare January 9, 2019 14:14
@Jyhess
Copy link
Contributor Author

Jyhess commented Jan 9, 2019

OK, I fixed some tests and normalized flask folders.
I think we are good for a first version.

@wing328 wing328 merged commit 80ca67c into OpenAPITools:master Jan 11, 2019
jimschubert added a commit that referenced this pull request Jan 12, 2019
* master:
  Add links to Patreon account (#1887)
  Python AIOHTTP server generator (#1470)
  Fix a problem that points to a folder that doesn't exist (#1863)
  Python: Update api_doc_example for multiple auth (#1870)
  [gradle] Add 4 boolean properties supported by codegenConfigurator (#1881)
A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
* Astract factory for generators based on connexion

* Add aiohttp server generator

* Fix flask tests

* Normalize python-flask folder names
@Jyhess Jyhess deleted the aiohttp_server_generator branch November 4, 2022 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants