Skip to content

Commit cb6a995

Browse files
prafullaAtSBSB-rohandhimanSB-ChetanKordeSB-akshaythakarSB-pradeep-bande
authored
Stop 2417 hide button (#2816)
* added condition * Added clear selection functionality in-mid code for required * extra type for array removed * required button logic implemented * added logic to hide nested array properties * Bump up version for elements core changes * removed properties from child path created for array items and schema object inside array * fix: fixed issue for root level model reference rendering with masking * fix : schema combiner for preview --------- Co-authored-by: Rohan Dhiman <rohan.dhiman@smartbear.com> Co-authored-by: SB-ChetanKorde <chetan.korde@smartbear.com> Co-authored-by: Akshay Thakar <akshay.thakar@smartbear.com> Co-authored-by: Pradeep Bande <pradeep.bande@smartbear.com> Co-authored-by: SB-virendrasolanke <virendra.solanke@smartbear.com>
1 parent 09d9a6c commit cb6a995

9 files changed

Lines changed: 280 additions & 51 deletions

File tree

packages/elements-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@stoplight/elements-core",
3-
"version": "9.0.4",
3+
"version": "9.0.5",
44
"sideEffects": [
55
"web-components.min.js",
66
"src/web-components/**",

packages/elements-core/src/components/Docs/HttpOperation/Body.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,13 @@ export const Body = ({ body, onChange, isHttpWebhookOperation = false, disablePr
5151
const absolutePathsToHide: Array<{ path: string; required?: boolean }> = [];
5252
disablePropsConfig.forEach(configEntry => {
5353
const { location, paths } = configEntry;
54-
paths.forEach(item => {
55-
// Construct the full absolute path
54+
paths.forEach((item: any) => {
5655
const fullPath = location === '#' ? item?.path : `${location}/${item.path}`;
57-
absolutePathsToHide.push({ path: fullPath });
56+
let object: any = { path: fullPath };
57+
if (item.hasOwnProperty('required')) {
58+
object = { ...object, required: item?.required };
59+
}
60+
absolutePathsToHide.push(object);
5861
});
5962
});
6063
return absolutePathsToHide;

0 commit comments

Comments
 (0)