Skip to content
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

Modify responseType by Object(json) or Array(json5) #813

Merged
merged 1 commit into from
Apr 26, 2020

Conversation

shtakai
Copy link
Contributor

@shtakai shtakai commented Apr 26, 2020

Why?

support response json array · Issue #805 · liyasthomas/postwoman

How?

Behavior

Editor component can't recognize json Array.
(It accepts json Object.)
If JSON Array, set this.responseBodyType 'json5'.

Fixing

  • When 'responseTypeisjson/ etc`, responseBodyType will be set
    • json : response.body.type's constructor name is Object. (Usual case)
    • json5 : response.body.type's constructor name is Array. (support response json array #805 's case)

Screenshots

  • JSON Array
    Screenshot from 2020-04-26 13-30-24
    Screenshot from 2020-04-26 13-30-51

  • JSON Object
    Screenshot from 2020-04-26 13-41-56
    Screenshot from 2020-04-26 13-42-05

Editor component can't recognize json Array.
(It accepts json Object.)
If json Array, set this.responseBodyType 'json5'.
@TravisBuddy
Copy link

Hey @shtakai,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: ed592890-8778-11ea-9c26-c9c9fa839a9b

@liyasthomas
Copy link
Member

@shtakai thanks for the quick PR 👍

@liyasthomas liyasthomas linked an issue Apr 26, 2020 that may be closed by this pull request
@liyasthomas liyasthomas merged commit 3924077 into hoppscotch:master Apr 26, 2020
@shtakai shtakai deleted the feature/json_array branch April 26, 2020 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support response json array
3 participants