Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

[external] bugfix: fix escaping in orders #1433

Merged
merged 3 commits into from
Sep 19, 2023

Conversation

bobbyshaw
Copy link
Contributor

[DEVDOCS-]

The OpenAPI parser was unable to comprehend the escaping approach of this example on an orders endpoint. I've modified it to use single quotes so that the double quotes don't need to be escaped.

What changed?

Provide a bulleted list in the present tense

  • change escaping of orders example for improved ability to parse.

Anything else?

Add related PRs, salient notes, ticket numbers, etc.

ping {names}

@slsriehl
Copy link
Contributor

@bobbyshaw can you resolve conflicts to incorporate 5c27dd4?

In addition, can you provide a response to document that the strings received do NOT include the \ escape literals? I'm trying to determine which is more accurate -- '{"foo": "bar"}' or '{\"foo\": \"bar\"}'.

Otherwise OpenAPI parsing error is:

Colons must be followed by a space or an indication character (i.e. " ", ",", "[", "]", "{", "}") at line 2195 (near "value: {\"originalName\":\"BigCommerceLogo.jpeg\",\"temporaryPath\":\"121_fbfb71dfc5a5d911f62d8e35dedd6e45.jpeg\",\"path\":\"f606efcae7e179970b19c3658142c5d0.jpeg\"}").
@bobbyshaw
Copy link
Contributor Author

bobbyshaw commented Sep 10, 2023

Hi @slsriehl, I've rebased.

Thanks for your suggestion to check the response document. I found that the response document does have the escapes:

[
    {
        "id": 11,
        "order_id": 107,
        "product_options": [
            {
                "id": 9,
                "option_id": 37,
                "order_product_id": 11,
                "product_option_id": 116,
                "display_name": "Logo",
                "display_name_customer": "Logo",
                "display_name_merchant": "Logo",
                "display_value": "BigCommerce-logo-dark.png",
                "display_value_customer": "BigCommerce-logo-dark.png",
                "display_value_merchant": "BigCommerce-logo-dark.png",
                "value": "{\"originalName\":\"BigCommerce-logo-dark.png\",\"temporaryPath\":\"116_db8ccbbddf55c73bc7d6bcc2ae10b459.png\",\"path\":\"e214d766ffcf9476a592f341f4631f8a.png\"}",
                "type": "File upload field",
                "name": "Logo1694339766-112",
                "display_style": ""
            }
        ],
    }
]

I've updated my fix to just double-quote which still resolves my issue without changing the value example.

@slsriehl slsriehl changed the title Fix escaping in orders [external] bugfix: fix escaping in orders Sep 19, 2023
@slsriehl slsriehl merged commit a778645 into bigcommerce:main Sep 19, 2023
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants