fix: streamline management of user-selected produces and consumes values (#4137)

* Remove produces/consumes setter from OperationContainer

* Store consumes/produces information in `meta` key

* Migrate produces value state usage to `meta` key

* use meta consumes data for isXml check

* Fix failing tests

* normalize action name casing

* restore correct produces fallback value logic
This commit is contained in:
kyle
2018-01-18 20:37:44 -06:00
committed by GitHub
parent ec4890299c
commit 7af7121e64
7 changed files with 135 additions and 39 deletions

View File

@@ -19,7 +19,7 @@ export const LOG_REQUEST = "spec_log_request"
export const CLEAR_RESPONSE = "spec_clear_response"
export const CLEAR_REQUEST = "spec_clear_request"
export const CLEAR_VALIDATE_PARAMS = "spec_clear_validate_param"
export const UPDATE_OPERATION_VALUE = "spec_update_operation_value"
export const UPDATE_OPERATION_META_VALUE = "spec_update_operation_meta_value"
export const UPDATE_RESOLVED = "spec_update_resolved"
export const SET_SCHEME = "set_scheme"
@@ -150,14 +150,14 @@ export function clearValidateParams( payload ){
export function changeConsumesValue(path, value) {
return {
type: UPDATE_OPERATION_VALUE,
type: UPDATE_OPERATION_META_VALUE,
payload:{ path, value, key: "consumes_value" }
}
}
export function changeProducesValue(path, value) {
return {
type: UPDATE_OPERATION_VALUE,
type: UPDATE_OPERATION_META_VALUE,
payload:{ path, value, key: "produces_value" }
}
}