-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Streamline management of user-selected produces and consumes values (WIP)
#4137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| } | ||
|
|
||
| componentWillReceiveProps(nextProps) { | ||
| const defaultContentType = "application/json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to be sure to preserve this default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha
| } | ||
|
|
||
| if (producesValue === undefined) { | ||
| producesValue = produces && produces.size ? produces.first() : defaultContentType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve this logic
src/core/plugins/spec/actions.js
Outdated
| 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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the case here
| return state.setIn( [ "mutatedRequests", path, method ], fromJSOrdered(req)) | ||
| }, | ||
|
|
||
| [UPDATE_OPERATION_VALUE]: (state, { payload: { path, value, key } }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be documented as an internal API change in release notes.
Fixes #3998.
This is a 90% solution. The ContentType select components still transmit their default values, but the consumes/produces logic was removed from OperationContainer, so that logic only runs when it has to.