Skip to content

Commit

Permalink
Rename 'ampersandEscaped' to 'space' for query params array config (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
alephao authored Sep 18, 2019
1 parent 987f882 commit 2fcaab3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
8 changes: 2 additions & 6 deletions lib/src/models/types/parameter-serialization-strategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ export interface QueryParamSerializationStrategy {
}

/** Supported serialization strategies for arrays in query parameters */
export type QueryParamArrayStrategy =
| "ampersand"
| "ampersandEscaped"
| "comma"
| "pipe";
export type QueryParamArrayStrategy = "ampersand" | "space" | "comma" | "pipe";

/**
* Transform a parameter serialization strategy for array into
Expand All @@ -31,7 +27,7 @@ export function makeParamSerializationRulesForArray(
style: "form"
};
}
case "ampersandEscaped": {
case "space": {
return {
explode: false,
style: "spaceDelimited"
Expand Down
8 changes: 2 additions & 6 deletions lib/src/neu/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,11 @@ export interface Body {
* Supported serialization strategies for arrays in query parameters
*
* "ampersand": ?id=3&id=4&id=5
* "ampersandEscaped": ?id=3%204%205
* "space": ?id=3%204%205
* "comma": ?id=3,4,5
* "pipe": ?id=3|4|5
*/
export type QueryParamArrayStrategy =
| "ampersand"
| "ampersandEscaped"
| "comma"
| "pipe";
export type QueryParamArrayStrategy = "ampersand" | "space" | "comma" | "pipe";

/** Supported HTTP methods */
export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
2 changes: 1 addition & 1 deletion lib/src/neu/parsers/parser-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ export function isQueryParamArrayStrategy(
): strategy is QueryParamArrayStrategy {
switch (strategy) {
case "ampersand":
case "ampersandEscaped":
case "space":
case "comma":
case "pipe":
return true;
Expand Down

0 comments on commit 2fcaab3

Please sign in to comment.