[GH-ISSUE #1097] Linter error is shown for response body if response is a JSON Array #383

Closed
opened 2026-03-16 14:58:59 +03:00 by kerem · 4 comments
Owner

Originally created by @amodmahajan2016 on GitHub (Aug 19, 2020).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1097

Originally assigned to: @AndrewBastin on GitHub.

I hit an API that gives a response in a JSON array.
https://restful-booker.herokuapp.com/booking

Response -
[{"bookingid":7},{"bookingid":4},{"bookingid":5},{"bookingid":6},{"bookingid":10},{"bookingid":9},{"bookingid":1},{"bookingid":12},{"bookingid":2},{"bookingid":3},{"bookingid":8},{"bookingid":11}]

But postWoman gives an error:-
image

Originally created by @amodmahajan2016 on GitHub (Aug 19, 2020). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1097 Originally assigned to: @AndrewBastin on GitHub. I hit an API that gives a response in a JSON array. https://restful-booker.herokuapp.com/booking Response - [{"bookingid":7},{"bookingid":4},{"bookingid":5},{"bookingid":6},{"bookingid":10},{"bookingid":9},{"bookingid":1},{"bookingid":12},{"bookingid":2},{"bookingid":3},{"bookingid":8},{"bookingid":11}] But postWoman gives an error:- ![image](https://user-images.githubusercontent.com/20769876/90635834-5a136f80-e247-11ea-9a28-34226a30c3ad.png)
kerem 2026-03-16 14:58:59 +03:00
  • closed this issue
  • added the
    bug
    minor
    labels
Author
Owner

@liyasthomas commented on GitHub (Aug 20, 2020):

Probably an issue with language selector in JSON lens.
github.com/hoppscotch/hoppscotch@9734e4d859/components/lenses/renderers/JSONLensRenderer.vue (L46)

Will look into it ASAP.

<!-- gh-comment-id:677228725 --> @liyasthomas commented on GitHub (Aug 20, 2020): Probably an issue with language selector in JSON lens. https://github.com/hoppscotch/hoppscotch/blob/9734e4d859e46453fcd3ca3366c4f54a81354417/components/lenses/renderers/JSONLensRenderer.vue#L46 Will look into it ASAP.
Author
Owner

@liyasthomas commented on GitHub (Aug 22, 2020):

@AndrewBastin any idea why this is happening?

refer: https://stackoverflow.com/questions/31136597/how-to-make-an-intellisense-for-array-type-json-in-ace-js-editor

<!-- gh-comment-id:678598912 --> @liyasthomas commented on GitHub (Aug 22, 2020): @AndrewBastin any idea why this is happening? refer: https://stackoverflow.com/questions/31136597/how-to-make-an-intellisense-for-array-type-json-in-ace-js-editor
Author
Owner

@AndrewBastin commented on GitHub (Aug 22, 2020):

Oops. We use the JSON parser for linting from graphiql. They don't allow root to be an array even though it is valid according to the JSON spec. Well, it is not a breaking issue, but I will still have a look at fixing it.

<!-- gh-comment-id:678599312 --> @AndrewBastin commented on GitHub (Aug 22, 2020): Oops. We use the JSON parser for linting from graphiql. They don't allow root to be an array even though it is valid according to the JSON spec. Well, it is not a breaking issue, but I will still have a look at fixing it.
Author
Owner

@AndrewBastin commented on GitHub (Aug 26, 2020):

@amodmahajan2016 it should be fixed now. But please feel free to reopen if it still persists ^_^

<!-- gh-comment-id:681155849 --> @AndrewBastin commented on GitHub (Aug 26, 2020): @amodmahajan2016 it should be fixed now. But please feel free to reopen if it still persists ^_^
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#383
No description provided.