瀏覽代碼

Recalculate example value when requestBody value changes

bubble
Kyle Shockey 6 年之前
父節點
當前提交
200b361328
共有 1 個檔案被更改,包括 7 行新增0 行删除
  1. +7
    -0
      src/core/plugins/oas3/components/request-body-editor.jsx

+ 7
- 0
src/core/plugins/oas3/components/request-body-editor.jsx 查看文件

@@ -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…
取消
儲存