We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如题,复现步骤和期望结果见下方描述。我初步怀疑是 @umijs/openapi 在处理继承时没有考虑合并properties声明的属性。
resolveAllOfObject(schemaObject: SchemaObject) { const props = (schemaObject.allOf || []).map((item) => item.$ref ? [{ ...item, type: getType(item).split('/').pop() }] : this.getProps(item), ); return { props }; }
swagger api 定义:
definitions: Response: type: object properties: code: type: string status: type: integer message: type: string discriminator: data BoolResponse: allOf: - $ref: '#/definitions/Response' type: object required: - data properties: data: type: boolean
通过 yarn openapi 生成的的最终结果:
yarn openapi
type Response = { code?: string; message?: string; status?: number; }; type BoolResponse = // #/components/schemas/Response Response;
type Response = { code?: string; message?: string; status?: number; }; type BoolResponse = // #/components/schemas/Response Response & {data: boolean};
package.json:
"dependencies": { "@ant-design/icons": "^4.7.0", "@ant-design/pro-components": "^2.3.37", "@ant-design/use-emotion-css": "1.0.4", "@umijs/plugin-openapi": "^1.3.3", "@umijs/route-utils": "^2.1.3", "antd": "^5.0.0", "classnames": "^2.3.2", "lodash": "^4.17.21", "moment": "^2.29.4", "omit.js": "^2.0.2", "rc-menu": "^9.6.4", "rc-util": "^5.24.4", "react": "^18.0.0", "react-dev-inspector": "^1.8.1", "react-dom": "^18.0.0", "react-helmet-async": "^1.3.0" },
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
🐛 bug 描述
如题,复现步骤和期望结果见下方描述。我初步怀疑是 @umijs/openapi 在处理继承时没有考虑合并properties声明的属性。
📷 复现步骤 | Recurrence steps
swagger api 定义:
通过
yarn openapi
生成的的最终结果:🏞 期望结果 | Expected results
© 版本信息
package.json:
🚑 其他信息
The text was updated successfully, but these errors were encountered: