-
-
Notifications
You must be signed in to change notification settings - Fork 281
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
Add support for tags and include responses without content #924
Conversation
The exact implementation of responses without content is still to be decided
There are 2 versions of |
Merging this PR would solve koxudaxi/fastapi-code-generator#114, koxudaxi/fastapi-code-generator#176 and koxudaxi/fastapi-code-generator#207 (if I understood these correctly). |
Codecov ReportBase: 100.00% // Head: 100.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #924 +/- ##
===========================================
Coverage 100.00% 100.00%
===========================================
Files 11 21 +10
Lines 1020 2603 +1583
Branches 201 614 +413
===========================================
+ Hits 1020 2603 +1583
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@Aedial |
@koxudaxi So, if I understand well, the "right" way would be to add another parameter to OpenAPIParser (datamodel_code_generator/parser/openapi.py#L244), generate (datamodel_code_generator/init.py#L200), and arg_parser (datamodel_code_generator/main.py#L349) ? I was fearing contributing to uncontrolled organic growth going this route, but it seems it is fine by you. |
I think we can add datamodel-code-generator/datamodel_code_generator/__main__.py Lines 102 to 108 in 10ae94f
datamodel-code-generator/datamodel_code_generator/__init__.py Lines 170 to 172 in 10ae94f
|
Do we need tags' logic in datamodel-code-generator? |
Putting the tags handling in fastapi-codegen makes things awkward, as it would mean putting a special clause for tags in parse_operation (fastapi-code-generator/parser.py), while keeping it in datamodel-code-generator stays consistent with the rest (parse_parameters, parse_request_body, parse_responses) and keeps the logic of Operation in one place. From a "separation of responsibilities" point of view, it feels cleaner. |
Just realized I never committed the tests (oops) |
@Aedial |
The exact implementation of responses without content is still to be decided