Browse Source

Recalculate example value when requestBody value changes

bubble
Kyle Shockey 6 years ago
parent
commit
200b361328
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      src/core/plugins/oas3/components/request-body-editor.jsx

+ 7
- 0
src/core/plugins/oas3/components/request-body-editor.jsx View File

@@ -48,6 +48,13 @@ export default class RequestBodyEditor extends PureComponent {
}
}

componentDidUpdate(prevProps) {
if(this.props.requestBody !== prevProps.requestBody) {
// force recalc of value if the request body definition has changed
this.setValueToSample(this.props.mediaType)
}
}

setValueToSample = (explicitMediaType) => {
this.onChange(this.sample(explicitMediaType))
}


Loading…
Cancel
Save