소스 검색

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))
}


불러오는 중...
취소
저장