Wrongly generated Axios clients when not using dto#2966
Closed
dubzzz wants to merge 1 commit intoRicoSuter:masterfrom
Closed
Wrongly generated Axios clients when not using dto#2966dubzzz wants to merge 1 commit intoRicoSuter:masterfrom
dubzzz wants to merge 1 commit intoRicoSuter:masterfrom
Conversation
Contributor
Author
|
Closing this PR for the moment, it might already be handled by #2927 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It seems that the Axios code generated by NSwag when we move from
"typeStyle": "Class"to"typeStyle": "Interface"comes with a bug.This Pull Request is supposed to fix the issue. Please let me know if I can add a specific test to cover this case and avoid it to come back in the future.
Here is the behaviour I observed when moving from
"typeStyle": "Class"to"typeStyle": "Interface".Actually here are the codes for
process*that have been generated with"typeStyle": "Class":In this version of
process*,response.dataholds the output as a normal JS Objects not a raw string that should be parsed to extract something from it. When we toggle"typeStyle": "Interface", the codeJSON.parse(response.data)crashes as we try to parse an object (or an already parsed string).When I moved towards
"typeStyle": "Interface":