-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[TypeScript] Make OpenAPI Generator serialize subclasses properly #102
Conversation
Motivation ---- Previously, when serializing as subclass of a property, generated swagger clients would only serialize properties of the parent class causing some values to not be pass through Modifications ---- Before serializing attributes of a given type, we check to see if there is a specific type to be serialized so that we don't miss any properties.
@@ -78,6 +83,9 @@ class ObjectSerializer { | |||
if (!typeMap[type]) { // in case we dont know the type | |||
return data; | |||
} | |||
|
|||
// Get the actual type of this object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gbrown-ce Can we use 4-space instead of tab for indentation here?
Motivation ---- OpenAPI Generator upstream requested whitespace fixes (from tabs to 4 spaces) Modifications ---- Fixed whitespace
I think this does not fix the underlying issue and is merely a convenient workaround: I think a proper fix for this would need to rewrite the serializer to support those 3 constraints. e.g.
|
Ignore my comment above. I misunderstood the issue initially and gbrown-ce helped clear it up in #100. |
If no one has further feedback on this PR, I"ll merge it tomorrow (Fri). |
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
.Description of the PR
Motivation
Previously, when serializing as subclass of a property, generated swagger clients would only serialize properties of the parent class causing some values to not be pass through
Modifications
Before serializing attributes of a given type, we check to see if there is a specific type to be serialized so that we don't miss any properties.
Issue: #100
@TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx @macjohnny @wing328