Skip to content

cURL Breaking without -g #253

@chaffeqa

Description

@chaffeqa

Describe the bug
When using GraphQL query bodies in GET requests, the codegen cURL will fail with
curl: (3) nested brace in URL position 122:.
However it will pass if -g is added to the request.

To Reproduce
Steps to reproduce the behavior:

curl --location --request GET 'https://picks-dev.cbssports.com/graphql?query=query%20APIBracketLobbyQuery%20{%0A%20%20bpc:%20gameInstance(game:%20{%20uid:%20%22cbs-ncaab-tournament-challenge%22%20})%20{%0A%20%20%20%20...APIGameInstanceFragment%0A%20%20}%0A%20%20bpm:%20gameInstance(game:%20{%20uid:%20%22cbs-ncaab-tournament-manager%22%20})%20{%0A%20%20%20%20...APIGameInstanceFragment%0A%20%20}%0A%20%20currentUser%20{%0A%20%20%20%20preferredEntryName%0A%20%20%20%20bpcEntries:%20entries(%0A%20%20%20%20%20%20first:%20200%0A%20%20%20%20%20%20gameInstanceUid:%20%22cbs-ncaab-tournament-challenge%22%0A%20%20%20%20)%20{%0A%20%20%20%20%20%20edges%20{%0A%20%20%20%20%20%20%20%20node%20{%0A%20%20%20%20%20%20%20%20%20%20...APILobbyEntryFragment%0A%20%20%20%20%20%20%20%20}%0A%20%20%20%20%20%20}%0A%20%20%20%20}%0A%20%20%20%20bpmEntries:%20entries(%0A%20%20%20%20%20%20first:%20200%0A%20%20%20%20%20%20gameInstanceUid:%20%22cbs-ncaab-tournament-manager%22%0A%20%20%20%20)%20{%0A%20%20%20%20%20%20edges%20{%0A%20%20%20%20%20%20%20%20node%20{%0A%20%20%20%20%20%20%20%20%20%20...APILobbyEntryFragment%0A%20%20%20%20%20%20%20%20}%0A%20%20%20%20%20%20}%0A%20%20%20%20}%0A%20%20}%0A}%0Afragment%20APIGameInstanceFragment%20on%20GameInstance%20{%0A%20%20uid%0A%20%20seasons(first:%20100)%20{%0A%20%20%20%20edges%20{%0A%20%20%20%20%20%20node%20{%0A%20%20%20%20%20%20%20%20id%0A%20%20%20%20%20%20%20%20year%0A%20%20%20%20%20%20%20%20masterProductId%0A%20%20%20%20%20%20%20%20productAbbrev%0A%20%20%20%20%20%20%20%20challengePoolId%0A%20%20%20%20%20%20}%0A%20%20%20%20}%0A%20%20}%0A%20%20currentPeriod%20{%0A%20%20%20%20...APILobbyCurrentPeriodFragment%0A%20%20}%0A}%0Afragment%20APILobbyCurrentPeriodFragment%20on%20Period%20{%0A%20%20locksAt%0A%20%20isPickable%0A%20%20segment%20{%0A%20%20%20%20shouldPromoteToPlay%0A%20%20%20%20season%20{%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20masterProductId%0A%20%20%20%20%20%20challengePoolId%0A%20%20%20%20}%0A%20%20}%0A}%0Afragment%20APILobbyEntryFragment%20on%20Entry%20{%0A%20%20id%0A%20%20name%0A%20%20fantasyPoints%0A%20%20poolRank%0A%20%20url%0A%20%20needsToMakePicks%0A%20%20avatarUrl%0A%20%20periodPoint%20{%0A%20%20%20%20poolRank%0A%20%20%20%20fantasyPoints%0A%20%20}%0A%20%20pool%20{%0A%20%20%20%20id%0A%20%20%20%20name%0A%20%20%20%20url%0A%20%20%20%20season%20{%0A%20%20%20%20%20%20masterProductId%0A%20%20%20%20}%0A%20%20}%0A}%0A'

vs

curl -g --location --request GET 'https://picks-dev.cbssports.com/graphql?query=query%20APIBracketLobbyQuery%20{%0A%20%20bpc:%20gameInstance(game:%20{%20uid:%20%22cbs-ncaab-tournament-challenge%22%20})%20{%0A%20%20%20%20...APIGameInstanceFragment%0A%20%20}%0A%20%20bpm:%20gameInstance(game:%20{%20uid:%20%22cbs-ncaab-tournament-manager%22%20})%20{%0A%20%20%20%20...APIGameInstanceFragment%0A%20%20}%0A%20%20currentUser%20{%0A%20%20%20%20preferredEntryName%0A%20%20%20%20bpcEntries:%20entries(%0A%20%20%20%20%20%20first:%20200%0A%20%20%20%20%20%20gameInstanceUid:%20%22cbs-ncaab-tournament-challenge%22%0A%20%20%20%20)%20{%0A%20%20%20%20%20%20edges%20{%0A%20%20%20%20%20%20%20%20node%20{%0A%20%20%20%20%20%20%20%20%20%20...APILobbyEntryFragment%0A%20%20%20%20%20%20%20%20}%0A%20%20%20%20%20%20}%0A%20%20%20%20}%0A%20%20%20%20bpmEntries:%20entries(%0A%20%20%20%20%20%20first:%20200%0A%20%20%20%20%20%20gameInstanceUid:%20%22cbs-ncaab-tournament-manager%22%0A%20%20%20%20)%20{%0A%20%20%20%20%20%20edges%20{%0A%20%20%20%20%20%20%20%20node%20{%0A%20%20%20%20%20%20%20%20%20%20...APILobbyEntryFragment%0A%20%20%20%20%20%20%20%20}%0A%20%20%20%20%20%20}%0A%20%20%20%20}%0A%20%20}%0A}%0Afragment%20APIGameInstanceFragment%20on%20GameInstance%20{%0A%20%20uid%0A%20%20seasons(first:%20100)%20{%0A%20%20%20%20edges%20{%0A%20%20%20%20%20%20node%20{%0A%20%20%20%20%20%20%20%20id%0A%20%20%20%20%20%20%20%20year%0A%20%20%20%20%20%20%20%20masterProductId%0A%20%20%20%20%20%20%20%20productAbbrev%0A%20%20%20%20%20%20%20%20challengePoolId%0A%20%20%20%20%20%20}%0A%20%20%20%20}%0A%20%20}%0A%20%20currentPeriod%20{%0A%20%20%20%20...APILobbyCurrentPeriodFragment%0A%20%20}%0A}%0Afragment%20APILobbyCurrentPeriodFragment%20on%20Period%20{%0A%20%20locksAt%0A%20%20isPickable%0A%20%20segment%20{%0A%20%20%20%20shouldPromoteToPlay%0A%20%20%20%20season%20{%0A%20%20%20%20%20%20id%0A%20%20%20%20%20%20masterProductId%0A%20%20%20%20%20%20challengePoolId%0A%20%20%20%20}%0A%20%20}%0A}%0Afragment%20APILobbyEntryFragment%20on%20Entry%20{%0A%20%20id%0A%20%20name%0A%20%20fantasyPoints%0A%20%20poolRank%0A%20%20url%0A%20%20needsToMakePicks%0A%20%20avatarUrl%0A%20%20periodPoint%20{%0A%20%20%20%20poolRank%0A%20%20%20%20fantasyPoints%0A%20%20}%0A%20%20pool%20{%0A%20%20%20%20id%0A%20%20%20%20name%0A%20%20%20%20url%0A%20%20%20%20season%20{%0A%20%20%20%20%20%20masterProductId%0A%20%20%20%20}%0A%20%20}%0A}%0A'

Expected code snippet and corresponding request
Add -g to all cURL requests by default or properly deal with double vs single quotes (#251)

Additional context
collection: 11254382-24f763ba-01f6-4782-85c5-f65f3809457b
Version of postman-code-generators/Postman app: Version 7.24.0 (7.24.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions