Skip to content

Support binary and text responses #129

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

Merged
merged 14 commits into from
Apr 1, 2021

Conversation

mankdev
Copy link
Contributor

@mankdev mankdev commented Nov 8, 2020

Hi,

This PR adds support for file type response using definition {type: 'string', format: 'binary'}, it is valid for both 2.0 and 3.0 specs.

I suggest treating blob data as unknown since it can be handled by http-client implementation

Also it extends Request type with additional field responseType: 'json' | 'blob' | 'text' because this information required for proper http-client implementation.

For now, I've implemented only support for 2.0 spec, but if you guys ok with the approach, I will add support for 3.0.

@mankdev mankdev changed the title WIP: Support binary and text responses Support binary and text responses Nov 8, 2020
@mankdev mankdev marked this pull request as ready for review November 14, 2020 05:31
@raveclassic
Copy link
Contributor

Hi @mankdev, thanks for the PR! We have however some concerns on the suggested implementation, especially on the part with "deep lookup". Could you please clarify in details what are you trying to suggest and how does it correlate with OA3/swagger2 specs? Thanks!

@raveclassic raveclassic added enhancement New feature or request language: typescript 2.0 Typescript language template for Swagger 2.0 spec language: typescript 3.0 Typescript language template for OpenAPI 3.0 spec labels Dec 1, 2020
@mankdev
Copy link
Contributor Author

mankdev commented Dec 10, 2020

You are right, deepLookup was redundant. I removed it. It is simplified code a lot =)
Now I just checking produces for 2.0 and content types for 3.0

# Conflicts:
#	src/language/typescript/common/data/serialized-type.ts
@mankdev mankdev requested a review from raveclassic December 10, 2020 12:08
raveclassic
raveclassic previously approved these changes Dec 24, 2020
@raveclassic
Copy link
Contributor

@mankdev LGTM, but please resolve conflicts

# Conflicts:
#	src/language/typescript/3.0/serializers/operation-object.ts
@mankdev
Copy link
Contributor Author

mankdev commented Dec 25, 2020

@raveclassic done

@mankdev mankdev requested a review from raveclassic January 3, 2021 15:06
@dramoturg dramoturg removed the request for review from raveclassic April 1, 2021 20:54
@dramoturg dramoturg self-requested a review April 1, 2021 21:24
@dramoturg dramoturg merged commit 977f534 into devexperts:master Apr 1, 2021
@kokovtsev kokovtsev mentioned this pull request May 28, 2021
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request language: typescript 2.0 Typescript language template for Swagger 2.0 spec language: typescript 3.0 Typescript language template for OpenAPI 3.0 spec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants