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

(no ticket): [revise] query param include should accept comma separated list of values #1527

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

matthewvolk
Copy link
Contributor

What changed?

For context, this PR originated from: matthewvolk/bigrequest#84 as a solution for inconsistent Typescript type definitions being generated from our OpenAPI spec files. I haven't checked if these changes introduce any unintended side effects to other ways our spec files are consumed!

  • Refactors the schema definition of the include query parameter across various API endpoints to indicate that include accepts a comma-separated list of enum values, rather than one-of an enum value.
  • A schema with type: string and enum: [value1,value2] resolves to: ?include=[value1|value2] (either value1 or value2) (source: swagger.io)
  • If we instead describe the schema as a type: array, where the items in the array are of type: string and can be one or more of items.enum: [value1,value2] the schema now resolves to: ?include=[value1[,value2]
  • explode: false is also added to indicate that query parameter values can be expressed in the format: /users?id=3,4,5 as opposed to /users?id=3&id=4&id=5 (source: swagger.io))

Anything else?

There are a number of locations in other files that we may want to apply these changes to, but I haven't confirmed that each location accepts a comma separated list of strings. Here is a list: https://github.com/search?q=repo%3Abigcommerce%2Fapi-specs%20%22-%20name%3A%20include%22&type=code

@matthewvolk
Copy link
Contributor Author

fixes matthewvolk/bigrequest#84

Copy link
Contributor

@slsriehl slsriehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank @matthewvolk !

@slsriehl slsriehl merged commit 0a2de47 into bigcommerce:main Dec 15, 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