-
-
Notifications
You must be signed in to change notification settings - Fork 7k
[typescript-fetch] to fix incorrect parsing with additional properties #20923
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -265,7 +265,7 @@ export class {{classname}} extends runtime.BaseAPI { | |
{{/isEnumRef}} | ||
{{^isEnumRef}} | ||
{{^withoutRuntimeChecks}} | ||
formParams.append('{{baseName}}', new Blob([JSON.stringify({{{dataType}}}ToJSON(requestParameters['{{paramName}}']))], { type: "application/json", })); | ||
formParams.append('{{baseName}}', new Blob([JSON.stringify({{returnType}}ToJSON(requestParameters['{{paramName}}']))], { type: "application/json", })); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we add a fixture (generated sample) to the repository that shows this change? Or have the samples not been regenerated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @joscha Okay, so I retried on WSL and it seems the |
||
{{/withoutRuntimeChecks}}{{#withoutRuntimeChecks}} | ||
formParams.append('{{baseName}}', new Blob([JSON.stringify(requestParameters['{{paramName}}'])], { type: "application/json", })); | ||
{{/withoutRuntimeChecks}} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "Sample API", | ||
"description": "This is sample api", | ||
"version": "v1" | ||
}, | ||
"paths": { | ||
"/example_api_101": { | ||
"post": { | ||
"tags": [ | ||
"Example" | ||
], | ||
"summary": "Process Auth", | ||
"parameters": [ | ||
{ | ||
"name": "Id", | ||
"in": "query", | ||
"schema": { | ||
"type": "integer", | ||
"format": "int32" | ||
} | ||
} | ||
], | ||
"requestBody": { | ||
"content": { | ||
"multipart/form-data": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"paRes": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "string" | ||
}, | ||
"description": "Form sent for Authentication" | ||
} | ||
} | ||
}, | ||
"encoding": { | ||
"paRes": { | ||
"style": "form" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/ResponseOfString" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"ResponseOfString": { | ||
"type": "object", | ||
"properties": { | ||
"message": { | ||
"type": "string", | ||
"nullable": true | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
} | ||
} | ||
} |
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.
We should revert these - probably because regeneration was done on windows?
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.
Hello, thank you for the feedback.
I also think it was because of Windows. I'll try using a Linux machine instead to effectively undo my own changes
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.
you can use WSL instead
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.
Thank you. Done