feature: allowEmptyValue controls (#4788)
* add baseline tests * coerce empty strings to null when updating parameter values * add ParameterIncludeEmpty * add redux management for empty parameter value inclusion state * use name+in keying for state management instead of hash keying * update new redux method usages to name+in keying * coerce empty Immutable iterables in onChangeWrapper * OAS3 tests & support * add included empty parameters to requests before dispatching to Swagger Client * make empty inclusion interface prettier * add tests for #4587 * linter fixes * check for truthy value before reaching into property
This commit is contained in:
@@ -178,4 +178,26 @@ describe("spec plugin - reducer", function(){
|
||||
expect(value).toEqual(`{ "a": 123 }`)
|
||||
})
|
||||
})
|
||||
describe("SPEC_UPDATE_EMPTY_PARAM_INCLUSION", function() {
|
||||
it("should store parameter values by name+in", () => {
|
||||
const updateParam = reducer["spec_update_empty_param_inclusion"]
|
||||
|
||||
const path = "/pet/post"
|
||||
const method = "POST"
|
||||
|
||||
const state = fromJS({})
|
||||
|
||||
const result = updateParam(state, {
|
||||
payload: {
|
||||
pathMethod: [path, method],
|
||||
paramName: "param",
|
||||
paramIn: "query",
|
||||
includeEmptyValue: true
|
||||
}
|
||||
})
|
||||
|
||||
const response = result.getIn(["meta", "paths", path, method, "parameter_inclusions", "param.query"])
|
||||
expect(response).toEqual(true)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user