Better importMapping handling when aliasing references#4350
Better importMapping handling when aliasing references#4350wing328 merged 9 commits intoOpenAPITools:masterfrom
Conversation
- type of TypeAlias changed from 'string' to 'object' (not sure if importMapping is supposed also for 'string' types...) - there might be better ways to write the test, it's kind of a brute force test (generate a file and parse it with a regexp)
The patch from @bkoziak also fixes my test case OpenAPITools#3589
|
Do I need to do anything so that the PR can be merged? Should I declare the Bug #3589 as fixed now or only once this PR has been merged? |
|
UDPATE: merged latest master into this branch but got the following error: Updated that test case but found that python experimental petstore samples will have some changes such as --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py
+++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py
@@ -538,7 +538,7 @@ class FakeApi(object):
async_req (bool): execute request asynchronously
Returns:
- outer_number.OuterNumber
+ float
If the method is called asynchronously, returns the request
thread.
"""
@@ -565,7 +565,7 @@ class FakeApi(object):
self.fake_outer_number_serialize = Endpoint(
settings={
- 'response_type': (outer_number.OuterNumber,),
+ 'response_type': (float,),so I need some time to figure out why there's a change to codegenOperation.returnBaseType: - Assert.assertEquals(codegenOperation.returnBaseType, "V1beta3Binding");
+ Assert.assertEquals(codegenOperation.returnBaseType, "v1beta3_binding.V1beta3Binding"); |
I found the reason for the test failure (my branch introduced a new method in an ancestor class of the I'll have a fix shortly |
Fixes broken unit test after merge from master
|
@pe-st thanks for the quick fix. All tests passed. I'll take a look tomorrow and merge if no question from me or anyone. |
wing328
left a comment
There was a problem hiding this comment.
Reviewed and I'm ok with the approach to use import mapping to change how unalias-reference works. Let's have this in 4.3.0 release and see if our users have other feedback on this.
* type aliasing issue * Add example OpenAPI document from issue 3589 OpenAPITools#3589 * Add test to reproduce the issue - type of TypeAlias changed from 'string' to 'object' (not sure if importMapping is supposed also for 'string' types...) - there might be better ways to write the test, it's kind of a brute force test (generate a file and parse it with a regexp) * Remove duplicate test file * Add new method override handleMethodResponse Fixes broken unit test after merge from master Co-authored-by: bkoziak <[email protected]> Co-authored-by: William Cheng <[email protected]>
|
@pe-st thanks for the PR, which has been included in the 4.3.0 release: https://twitter.com/oas_generator/status/1243455743937789952 |
Fix from @bkoziak to make
importMappingwork for Java: #3589All the code in this PR was contributed by @bkoziak, I did just the merging and added one unit test.
PR checklist
./bin/(or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run./bin/{LANG}-petstore.sh,./bin/openapi3/{LANG}-petstore.shif updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).master,4.1.x,5.0.x. Default:master.