fix(oas): support additional props, fix circular references patch, and other fixes (#9213)

* chore(oas): support additional props, fix circular references patch, and other fixes

* fix description

* description fixes
This commit is contained in:
Shahed Nasser
2024-09-20 17:22:19 +03:00
committed by GitHub
parent 3084008fc9
commit 6a2a105cf8
8 changed files with 197 additions and 36 deletions

View File

@@ -16,6 +16,7 @@ decorators:
- ProductCategoryResponse
AdminShippingOption:
- AdminShippingOption
- AdminServiceZone
AdminProductCategory:
- AdminProductCategory
- AdminProduct
@@ -41,6 +42,8 @@ decorators:
AdminTaxRegion:
- AdminTaxRegion
- AdminTaxRate
AdminInventoryLevel:
- AdminInventoryItem
theme:
openapi:
theme:

View File

@@ -238,10 +238,13 @@ ${hint}
`
const redoclyConfigPath = path.join(basePath, "redocly", "redocly-config.yaml")
const originalContent = await readYaml(redoclyConfigPath) as CircularReferenceConfig
originalContent.decorators["medusa/circular-patch"].schemas = Object.assign(
originalContent.decorators["medusa/circular-patch"].schemas,
recommendation
)
Object.keys(recommendation).forEach((recKey) => {
originalContent.decorators["medusa/circular-patch"].schemas[recKey] = [
...originalContent.decorators["medusa/circular-patch"].schemas[recKey],
...recommendation[recKey]
]
})
await writeYaml(redoclyConfigPath, jsonObjectToYamlString(originalContent))
console.log(`🟡 Added the following unhandled circular references to redocly-config.ts:` + hintMessage)
}