@aomex/web
Advanced tools
Comparing version 0.0.12 to 0.0.13
# @aomex/web | ||
## 0.0.13 | ||
### Patch Changes | ||
- [`6e63df8`](https://github.com/aomex/aomex/commit/6e63df84d1b32e713aba8c52451e289a72b57bae) Thanks [@geekact](https://github.com/geekact)! - feat(web): make sure path parameter includes 'required' property when generate openapi document | ||
- [`67acf4f`](https://github.com/aomex/aomex/commit/67acf4f42cd86bf1f0a7c647a5ff779c7cd0fa10) Thanks [@geekact](https://github.com/geekact)! - feat(web): response.schema is optional | ||
- Updated dependencies []: | ||
- @aomex/core@0.0.12 | ||
## 0.0.12 | ||
@@ -4,0 +15,0 @@ |
@@ -417,3 +417,3 @@ import { Chain, PureChain, PureMiddlewareToken, Next, Middleware, OpenAPI, Validator, TransformedValidator, ValidateResult, ValidatorOptions } from '@aomex/core'; | ||
*/ | ||
schema: Validator | { | ||
schema?: Validator | { | ||
[key: string]: Validator; | ||
@@ -420,0 +420,0 @@ }; |
@@ -729,6 +729,9 @@ // src/override/middleware.ts | ||
Object.entries(this.props).forEach(([name, validator]) => { | ||
const validatorDocument = Validator4.toDocument(validator); | ||
methodItem.parameters.push({ | ||
name, | ||
in: "path", | ||
...Validator4.toDocument(validator) | ||
...validatorDocument, | ||
// path parameter must have "required" property that is set to "true" | ||
required: validatorDocument.required === true | ||
}); | ||
@@ -756,9 +759,9 @@ }); | ||
schema, | ||
headers = {}, | ||
headers, | ||
example, | ||
description = "" | ||
} = this.options; | ||
methodItem.responses[statusCode] = { | ||
description, | ||
content: { | ||
const responseObject = methodItem.responses[statusCode] = { description }; | ||
if (schema) { | ||
responseObject.content = { | ||
[this.fixContentType(contentType3)]: { | ||
@@ -770,4 +773,6 @@ schema: Validator5.toDocument( | ||
} | ||
}, | ||
headers: Object.fromEntries( | ||
}; | ||
} | ||
if (headers) { | ||
responseObject.headers = Object.fromEntries( | ||
Object.entries(headers).map(([key, header]) => [ | ||
@@ -777,4 +782,4 @@ key, | ||
]) | ||
) | ||
}; | ||
); | ||
} | ||
} | ||
@@ -781,0 +786,0 @@ fixContentType(contentType3) { |
{ | ||
"name": "@aomex/web", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "", | ||
@@ -29,3 +29,3 @@ "type": "module", | ||
"peerDependencies": { | ||
"@aomex/core": "^0.0.11" | ||
"@aomex/core": "^0.0.12" | ||
}, | ||
@@ -60,3 +60,3 @@ "dependencies": { | ||
"devDependencies": { | ||
"@aomex/core": "^0.0.11", | ||
"@aomex/core": "^0.0.12", | ||
"@types/co-body": "^6.1.0", | ||
@@ -63,0 +63,0 @@ "@types/content-type": "^1.1.5", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98541
1220